guoyujia 1 年間 前
コミット
ed35461309

+ 8 - 0
src/main/java/cn/ezhizao/project/business/process/controller/BizProcessController.java

@@ -7,6 +7,7 @@ import cn.ezhizao.framework.web.domain.AjaxResult;
 import cn.ezhizao.framework.web.page.TableDataInfo;
 import cn.ezhizao.project.business.process.domain.BizProcess;
 import cn.ezhizao.project.business.process.service.IBizProcessService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -54,6 +55,13 @@ public class BizProcessController extends BaseController {
     @Log(title = "标准工序", businessType = BusinessType.INSERT)
     @PostMapping(value = "/save")
     public AjaxResult save(@RequestBody BizProcess bizProcess) throws NoSuchFieldException, IllegalAccessException {
+        QueryWrapper<BizProcess> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("process_code", bizProcess.getProcessCode());
+        queryWrapper.eq("process_alias",bizProcess.getProcessAlias());
+        queryWrapper.eq("deleted", 0);
+        if (bizProcessService.list(queryWrapper).size() > 0) {
+            return error("该工序已存在");
+        }
         return toAjax(bizProcessService.saveOrUpdate(bizProcess));
     }
 

+ 10 - 10
src/main/java/cn/ezhizao/project/system/domain/SysUser.java

@@ -139,23 +139,23 @@ public class SysUser extends BaseEntity {
 
     private Long deptId;
     private String deptName;
-    private Long usageId;
-    private String usageCode;
+    private Long usageCompanyId;
+    private String usageCompanyName;
 
-    public Long getUsageId() {
-        return usageId;
+    public Long getUsageCompanyId() {
+        return usageCompanyId;
     }
 
-    public void setUsageId(Long usageId) {
-        this.usageId = usageId;
+    public void setUsageCompanyId(Long usageCompanyId) {
+        this.usageCompanyId = usageCompanyId;
     }
 
-    public String getUsageCode() {
-        return usageCode;
+    public String getUsageCompanyName() {
+        return usageCompanyName;
     }
 
-    public void setUsageCode(String usageCode) {
-        this.usageCode = usageCode;
+    public void setUsageCompanyName(String usageCompanyName) {
+        this.usageCompanyName = usageCompanyName;
     }
 
     public String getDeptName() {

+ 15 - 0
src/main/java/cn/ezhizao/project/tenant/controller/BizTenantController.java

@@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
@@ -81,6 +82,20 @@ public class BizTenantController extends BaseController {
         List<BizTenant> list = tenantService.getList(bizTenant);
         return getDataTable(list);
     }
+    @GetMapping("/info")
+    public AjaxResult info() {
+       QueryWrapper<BizTenant> queryWrapper = new QueryWrapper<>();
+       queryWrapper.eq("deleted",0);
+       List<BizTenant> oldList = tenantService.list(queryWrapper);
+       List<BizTenant> newList = new ArrayList<>();
+       for (BizTenant item : oldList) {
+           BizTenant bizTenant = new BizTenant();
+           bizTenant.setValue(item.getId());
+           bizTenant.setLabel(item.getOrgName());
+           newList.add(bizTenant);
+       }
+        return success(newList);
+    }
 
 //    @PreAuthorize("@ss.hasPermi('business:tenant:edit')")
     @GetMapping("/listMyTenant")

+ 6 - 0
src/main/java/cn/ezhizao/project/tenant/domain/BizTenant.java

@@ -88,4 +88,10 @@ public class BizTenant extends BaseEntity {
 
     @TableField(exist = false)
     private Integer applyStatus;
+    @TableField(exist = false)
+    private Long value;
+    @TableField(exist = false)
+    private String label;
+    @TableField(exist = false)
+    private Long tenantId;
 }

+ 20 - 19
src/main/resources/mybatis/system/SysUserMapper.xml

@@ -27,15 +27,14 @@
 		<result property="updateBy"            column="update_by"    />
 		<result property="updateTime"          column="update_time"  />
 		<result property="remark"              column="remark"       />
-		<result property="usageId"             column="usage_id"       />
-		<result property="usageCode"           column="usage_code"       />
+		<result property="usageCompanyId"      column="usage_company_id"       />
+		<result property="usageCompanyName"    column="usage_company_name"       />
 		<result property="isLeader"            column="is_leader"/>
 		<result property="isPartTime"          column="is_part_time"/>
 		<result property="isDispatcher"        column="is_dispatcher"/>
 		<result property="isFormman"           column="is_formman"/>
 		<result property="isYardman"           column="is_yardman"/>
 		<result property="isEdit"              column="is_edit"/>
-		<association property="deptName" column="usage_id" select="getDeptName"></association>
 		<collection  property="roles"   javaType="java.util.List"  resultMap="RoleResult" />
 	</resultMap>
 
@@ -49,16 +48,14 @@
 	</resultMap>
 
 	<sql id="selectUserTenantVo">
-		SELECT u.user_id, u.tenant_id, IFNULL(t.org_name, '超级管理员') AS tenant_name, u.user_type,u.user_name, u.nick_name, u.email,u.contract_company_name, u.contract_company_id, u.avatar, u.phone_number, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.usage_id,u.usage_code,
+		SELECT u.user_id, u.tenant_id, IFNULL(t.org_name, '超级管理员') AS tenant_name, u.user_type,u.user_name, u.nick_name, u.email,u.contract_company_name, u.contract_company_id, u.avatar, u.phone_number, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.usage_company_id,
+		u.usage_company_name,
 			   r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
 		FROM sys_user u
 		         LEFT JOIN biz_tenant t ON t.id = u.tenant_id
 				 LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id
 				 LEFT JOIN sys_role r ON r.role_id = ur.role_id
 	</sql>
-	<select id="getDeptName" resultType="String">
-		select dept_name deptName from sys_dept where dept_id = #{usage_id}
-	</select>
 	<select id="getListByDeptId" parameterType="java.util.List" resultMap="SysUserResult">
         SELECT u.*,
             -- 用于前端控制是否进入编辑状态
@@ -110,8 +107,10 @@
 		       u.login_date,
 		       u.create_by,
 		       u.create_time,
-		       u.usage_id,
-		       u.usage_code,
+		       u.usage_company_id,
+		       u.usage_company_name,
+		       u.contract_company_id,
+		       u.contract_company_name,
 		       u.remark FROM sys_user u left join sys_dept_user d on u.user_id = d.user_id
 		WHERE u.del_flag = '0' and d.deleted = 0
 		<if test="userId != null and userId != 0">
@@ -161,8 +160,10 @@
 		u.login_date,
 		u.create_by,
 		u.create_time,
-		u.usage_id,
-		u.usage_code,
+		u.usage_company_id,
+		u.usage_company_name,
+		u.contract_company_id,
+		u.contract_company_name,
 		u.remark FROM sys_user u
 		WHERE u.del_flag = '0'
 		<if test="userId != null and userId != 0">
@@ -213,8 +214,8 @@
 		   u.create_by,
 		   u.create_time,
 		   u.remark,
-		   u.usage_id,
-		   u.usage_code
+		u.usage_company_id,
+		u.usage_company_name
 		FROM sys_user u
 		WHERE u.del_flag = '0' AND u.user_type='02'
 		<if test="userId != null and userId != 0">
@@ -342,8 +343,8 @@
 		<if test="userType != null and userType != ''">user_type,</if>
 		<if test="contractCompanyName != null and contractCompanyName != ''">contract_company_name,</if>
 		<if test="contractCompanyId != null and contractCompanyId != ''">contract_company_id,</if>
-		<if test="usageId != null and usageId != 0">usage_id,</if>
-		<if test="usageCode != null and usageCode != ''">usage_code,</if>
+		<if test="usageCompanyId != null and usageCompanyId != 0">usage_company_id,</if>
+		<if test="usageCompanyName != null and usageCompanyName != ''">usage_company_name,</if>
 		create_time
 		)VALUES(
 		<if test="userId != null and userId != ''">#{userId},</if>
@@ -361,8 +362,8 @@
 		<if test="userType != null and userType != ''">#{userType},</if>
 		<if test="contractCompanyName != null and contractCompanyName != ''">#{contractCompanyName},</if>
 		<if test="contractCompanyId != null and contractCompanyId != ''">#{contractCompanyId},</if>
-		<if test="usageId != null and usageId != 0">#{usageId},</if>
-		<if test="usageCode != null and usageCode != 0">#{usageCode},</if>
+		<if test="usageCompanyId != null and usageCompanyId != 0">#{usageCompanyId},</if>
+		<if test="usageCompanyName != null and usageCompanyName != ''">#{usageCompanyName},</if>
 		sysdate()
 		)
 	</insert>
@@ -385,8 +386,8 @@
 			<if test="remark != null">remark = #{remark},</if>
 			<if test="contractCompanyName != null and contractCompanyName != ''">contract_company_name = #{contractCompanyName},</if>
 			<if test="contractCompanyId != null and contractCompanyId != ''">contract_company_id = #{contractCompanyId},</if>
-			<if test="usageId != null and usageId != 0">usage_id = #{usageId},</if>
-			<if test="usageCode != null and usageCode != 0">usage_code = #{usageCode},</if>
+			<if test="usageCompanyId != null and usageCompanyId != 0">usage_company_id = #{usageCompanyId},</if>
+			<if test="usageCompanyName != null and usageCompanyName != ''">usage_company_name = #{usageCompanyName},</if>
 			update_time = sysdate()
 		</set>
 		WHERE user_id = #{userId}