智慧保安后台管理-外网项目备份
tangzy
2021-11-09 013dbc7b2899215cb26483b0ffab5a14882a2e55
1.许可
6 files modified
67 ■■■■ changed files
src/main/java/org/springblade/modules/recordk/controller/RecordkController.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordk/entity/Recordk.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordk/mapper/RecordkMapper.java 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordk/mapper/RecordkMapper.xml 14 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordk/service/IRecordkService.java 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordk/service/impl/RecordkServiceImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordk/controller/RecordkController.java
@@ -28,7 +28,9 @@
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.information.service.IInformationService;
import org.springblade.modules.permit.entity.Permit;
import org.springblade.modules.permit.vo.PermitVO;
import org.springblade.modules.recordk.entity.Recordk;
import org.springblade.modules.recordk.service.IRecordkService;
import org.springblade.modules.recordk.vo.RecordkVO;
@@ -52,7 +54,7 @@
public class RecordkController extends BladeController {
    private final IRecordkService recordkService;
    private final IInformationService informationService;
    /**
     * 详情
     */
@@ -83,7 +85,21 @@
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入recordk")
    public R<IPage<RecordkVO>> page(RecordkVO recordk, Query query) {
        IPage<RecordkVO> pages = recordkService.selectRecordkPage(Condition.getPage(query), recordk);
        IPage<RecordkVO> pages;
        if (recordk.getUsetype().equals("0")) {
            pages = recordkService.selectRecordkPage(Condition.getPage(query), recordk,null);
        } else if (recordk.getUsetype().equals("1")) {
            String childer = informationService.selJurchilder(recordk.getJurisdiction());
            String[] split = childer.split(",");
            String strArrays = "";
            for (int j = 0; j < split.length; j++) {
                strArrays += "'" + split[j] + "',";
            }
            String jurisdiction = strArrays.substring(0, strArrays.length() - 1);
            pages = recordkService.selectRecordkPage(Condition.getPage(query), recordk,jurisdiction);
        } else {
            pages = recordkService.selectRecordkPage(Condition.getPage(query), recordk,null);
        }
        return R.data(pages);
    }
@@ -105,19 +121,15 @@
        recordk.setType("2");
        recordk.setPermitime(new Date());
        recordkService.save(recordk);
        String offtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(recordk.getOfficetime());
        String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(recordk.getPermitime());
        //String offtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(recordk.getOfficetime());
        //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(recordk.getPermitime());
        String s = "insert into sys_recordk(id,creditCode,enterpriseName,representative," +
            "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
            "address,business,region,registration,industry,type,permitime,deptid,ptype,representativecell,contacts,contactscell,perid,offices,officetime,cardid,overtime)" +
            "address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,cardid,overtime,jurisdiction)" +
            "values(" + "'" + recordk.getId() + "'" + "," + "'" + recordk.getCreditcode() + "'" + "," + "'" + recordk.getEnterprisename() + "'" + "," + "'"
            + recordk.getRepresentative() + "'" + "," +"'" + recordk.getRegisteredcapital() + "'" + "," + "'"
            + recordk.getOrganizationcode() + "'" + "," + "'" + recordk.getRegistrationnumber() + "'" + "," +
            "'" + recordk.getIdentificationnumber() + "'" + "," + "'" + recordk.getEnterprises() + "'" + "," + "'" +
            + recordk.getRepresentative() + "'" +"," + "'" +
            recordk.getAddress() + "'" + "," + "'" + recordk.getBusiness() + "'" + "," + "'" +
            recordk.getRegion() + "'" + "," + "'" + recordk.getRegistration() + "'" + "," + "'" + recordk.getIndustry() + "'" + "," + "'" + recordk.getType() + "'" + "," + "'" + pertime + "'" + "," + "'" + recordk.getDeptid() + "'" + "," + "'" + recordk.getPtype() + "'" + "," +
            "'" + recordk.getRepresentativecell() + "'" + "," + "'" + recordk.getContacts() + "'" + "," + "'" + recordk.getContactscell() + "'" + "," +
            "'" + recordk.getPerid() + "'" + "," + "'" + recordk.getOffices() + "'" + "," + "'" + offtime + "'"+ "," + "'" + recordk.getCardid() + "'"+"," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(recordk.getOvertime()) + "'"+")";
            recordk.getRegion() + "'" + "," + "'" + recordk.getRegistration() + "'" + "," + "'" + recordk.getIndustry() + "'" + "," + "'" + recordk.getType() + "'" +"," + "'" + recordk.getDeptid() + "'" + "," + "'" + recordk.getPtype() + "'" + "," +
            "'" + recordk.getRepresentativecell() + "'" + "," + "'" + recordk.getContacts() + "'" + "," + "'" + recordk.getContactscell() + "'" +","  + "'" + recordk.getCardid() + "'"+"," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(recordk.getOvertime())+ "'" +"," + "'" + recordk.getJurisdiction()+"'"+")";
        FtpUtil.sqlFileUpload(s);
        return R.success("成功");
    }
@@ -150,7 +162,11 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入recordk")
    public R update(@Valid @RequestBody Recordk recordk) {
        return R.status(recordkService.updateById(recordk));
        boolean b = recordkService.updateById(recordk);
        String s1 = "update sys_recordk set type = " + "'" + 0 + "'" + ",approve = " + "'" + recordk.getApprove() + "'" +
            " " + "where id = " + "'" + recordk.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        return R.status(b);
    }
    /**
src/main/java/org/springblade/modules/recordk/entity/Recordk.java
@@ -159,6 +159,7 @@
    private String contactscell;
    private String storage;
    private String approve;
    private String jurisdiction;
    @ApiModelProperty(value = "审批时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
src/main/java/org/springblade/modules/recordk/mapper/RecordkMapper.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.recordk.entity.Recordk;
import org.springblade.modules.recordk.vo.RecordkVO;
@@ -39,6 +40,6 @@
     * @param recordk
     * @return
     */
    List<RecordkVO> selectRecordkPage(IPage page, RecordkVO recordk);
    List<RecordkVO> selectRecordkPage(IPage page, @Param("recordk") RecordkVO recordk, String jurisdiction);
    Map selectIn(String cardid,String type);
}
src/main/java/org/springblade/modules/recordk/mapper/RecordkMapper.xml
@@ -30,14 +30,24 @@
        <result column="representativecell" property="representativecell"/>
        <result column="contacts" property="contacts"/>
        <result column="contactscell" property="contactscell"/>
        <result column="contactscell" property="contactscell"/>
        <result column="storage" property="storage"/>
        <result column="approve" property="approve"/>
        <result column="overtime" property="overtime"/>
        <result column="jurisdiction" property="jurisdiction"/>
    </resultMap>
    <select id="selectRecordkPage" resultMap="recordkResultMap">
        select * from sys_recordk
        select * from sys_recordk where 1=1
        <if test="recordk.ptype!=null and recordk.ptype!=''">
            and  ptype=#{recordk.ptype}
        </if>
        <if test="recordk.usetype=='1'.toString()">
            and jurisdiction in(${jurisdiction})
        </if>
        <if test="recordk.usetype=='2'.toString()">
            and jurisdiction=#{recordk.jurisdiction}
        </if>
    </select>
    <select id="selectIn" resultType="java.util.HashMap">
src/main/java/org/springblade/modules/recordk/service/IRecordkService.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.recordk.entity.Recordk;
import org.springblade.modules.recordk.vo.RecordkVO;
@@ -38,6 +39,6 @@
     * @param recordk
     * @return
     */
    IPage<RecordkVO> selectRecordkPage(IPage<RecordkVO> page, RecordkVO recordk);
    IPage<RecordkVO> selectRecordkPage(IPage<RecordkVO> page, @Param("recordk")RecordkVO recordk, String jurisdiction);
    Map selectIn(String cardid,String type);
}
src/main/java/org/springblade/modules/recordk/service/impl/RecordkServiceImpl.java
@@ -36,8 +36,8 @@
public class RecordkServiceImpl extends ServiceImpl<RecordkMapper, Recordk> implements IRecordkService {
    @Override
    public IPage<RecordkVO> selectRecordkPage(IPage<RecordkVO> page, RecordkVO recordk) {
        return page.setRecords(baseMapper.selectRecordkPage(page, recordk));
    public IPage<RecordkVO> selectRecordkPage(IPage<RecordkVO> page, RecordkVO recordk,String jurisdiction) {
        return page.setRecords(baseMapper.selectRecordkPage(page, recordk,jurisdiction));
    }
    @Override