Selaa lähdekoodia

20220902
合同管理-客户信息列表查询修改;
合同管理-客户信息新增根据名称、统一社会信用代码判断是否存在

sunruiqi 2 vuotta sitten
vanhempi
commit
0ecf8aca57

+ 11 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/controller/WorkClientController.java

@@ -37,8 +37,9 @@ public class WorkClientController {
     @ApiOperation(value = "客户信息列表")
     @GetMapping(value = "list")
     public ResponseEntity<IPage<WorkClientInfo>> list(WorkClientInfo workClientInfo, Page<WorkClientInfo> page) throws Exception {
+        String[] dates = workClientInfo.getCreateDates();
         QueryWrapper<WorkClientInfo> workClientInfoQueryWrapper = QueryWrapperGenerator.buildQueryCondition(workClientInfo, WorkClientInfo.class);
-        IPage<WorkClientInfo> list = workClientService.list(page,workClientInfoQueryWrapper);
+        IPage<WorkClientInfo> list = workClientService.list(page,workClientInfoQueryWrapper,dates);
         return ResponseEntity.ok (list);
     }
 
@@ -125,4 +126,13 @@ public class WorkClientController {
         }
         return TicketQueryUtils.enterpriseTicketInfoQueryById(id);
     }
+
+    /**
+     * 根据名称、统一社会信用代码判断是否存在
+     */
+    @ApiOperation(value = "根据名称、统一社会信用代码判断是否存在")
+    @GetMapping(value = "isExist")
+    public Integer isExist(@RequestParam String param) {
+        return workClientService.isExist(param);
+    }
 }

+ 11 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/domain/WorkClientInfo.java

@@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.jeeplus.core.domain.BaseEntity;
 import com.jeeplus.core.query.Query;
 import com.jeeplus.core.query.QueryType;
+import com.jeeplus.form.constant.TableColumn;
 import lombok.Data;
 
+import java.util.Date;
+
 /**
  * 客户管理Entity
  * @author 丁旭
@@ -19,7 +22,7 @@ public class WorkClientInfo extends BaseEntity {
     /**
      * 客户名称
      */
-    @Query()
+    @Query(tableColumn = "a.name")
     private String name;
 
     /**
@@ -35,16 +38,19 @@ public class WorkClientInfo extends BaseEntity {
     /**
      * 客户性质
      */
+    @Query
     private String companyType;
 
     /**
      * 客户行业
      */
+    @Query
     private String companyIndustry;
 
     /**
      * 客户类型
      */
+    @Query
     private String clientType;
 
     /**
@@ -126,6 +132,7 @@ public class WorkClientInfo extends BaseEntity {
     /**
      * 统一社会信用代码
      */
+    @Query
     private String uscCode;
 
     /**
@@ -137,5 +144,8 @@ public class WorkClientInfo extends BaseEntity {
      * 代表方(以逗号分割)
      */
     @TableField(exist = false)
+    @Query(type = QueryType.EQ, tableColumn = "f.job_type_id")
     private String deputy;
+
+    private String[] createDates;
 }

+ 2 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/mapper/WorkClientInfoMapper.java

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
 
 public interface WorkClientInfoMapper extends BaseMapper<WorkClientInfo> {
 
-    IPage<WorkClientInfo> findPageList(Page<WorkClientInfo> page , @Param(Constants.WRAPPER)QueryWrapper queryWrapper);
+    IPage<WorkClientInfo> findPageList(Page<WorkClientInfo> page, @Param(Constants.WRAPPER)QueryWrapper queryWrapper);
 
+    Integer isExist(@Param("value") String value);
 }

+ 12 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/mapper/xml/WorkClientInfoMapper.xml

@@ -47,9 +47,21 @@
 			work_client_info a
 		LEFT JOIN sys_area b ON a.area_id = b.`code`
 		LEFT JOIN sys_user su ON su.id = a.create_by
+		LEFT JOIN work_client_job_type_info f ON a.id = f.work_client_id
 		${ew.customSqlSegment}
 		ORDER BY
 			a.update_date DESC
 	</select>
 
+	<select id="isExist" resultType="java.lang.Integer">
+		SELECT
+			COUNT( 0 )
+		FROM
+			work_client_info
+		WHERE
+			del_flag = 0
+			AND (
+			`name` = #{value}
+			OR usc_code = #{value})
+	</select>
 </mapper>

+ 9 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/service/WorkClientService.java

@@ -59,9 +59,12 @@ public class WorkClientService {
      * @param
      * @return
      */
-    public IPage<WorkClientInfo> list(Page<WorkClientInfo> page, QueryWrapper<WorkClientInfo> queryWrapper) {
+    public IPage<WorkClientInfo> list(Page<WorkClientInfo> page, QueryWrapper<WorkClientInfo> queryWrapper, String[] dates) {
         queryWrapper.eq("a.del_flag","0");
-        IPage<WorkClientInfo> pageList = workClientInfoMapper.findPageList(page,queryWrapper);
+        if (dates != null) {
+            queryWrapper.between("a.create_date",dates[0], dates[1]);
+        }
+        IPage<WorkClientInfo> pageList = workClientInfoMapper.findPageList(page, queryWrapper);
         return pageList;
     }
 
@@ -292,4 +295,8 @@ public class WorkClientService {
         List<WorkClientInfo> workClientInfos = workClientInfoMapper.selectList(wrapper);
         return workClientInfos;
     }
+
+    public Integer isExist(String param) {
+        return workClientInfoMapper.isExist(param);
+    }
 }

+ 2 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/domain/BaseEntity.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.jeeplus.core.query.Query;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -34,6 +35,7 @@ public abstract class BaseEntity implements Serializable {
     /**
      * 创建人
      */
+    @Query
     @TableField(fill = FieldFill.INSERT)
     private String createBy;