Commit 6a0c3993 by yukang

Merge remote-tracking branch 'origin/dev' into dev

parents d0ddda17 546c2619
package com.baosight.hpjx.core.enums;
/**
* @author:songx
* @date:2024/3/1,17:29
*/
public enum UserStatusEnum {
ONLINE(1, "在职"),
OFFLINE(2, "离职"),
;
private Integer code;
private String value;
UserStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
......@@ -14,6 +14,8 @@ public class HPConstant {
*/
public class SequenceId {
// 用户ID
public static final String USER_ID = "USER_ID";
// 组织机构编码
public static final String ORG_CODE = "ORG_CODE";
// 组编码
......
......@@ -233,6 +233,18 @@ public class HPSqlConstant {
}
/**
* HPKC013 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC013 {
// 锁
public static final String UPDATE_STATUS = "HPKC013.updateStatus";
}
/**
* HPPZ010 SQL 定义
*
* @author:songx
......@@ -259,6 +271,30 @@ public class HPSqlConstant {
}
/**
* HPPZ013 SQL 定义
*
* @author:songx
* @date:2024/1/18,17:17
*/
public class HPPZ013 {
// 查询
public static final String UPDATE_STATUS = "HPPZ013.updateStatus";
}
/**
* HPPZ014 SQL 定义
*
* @author:songx
* @date:2024/1/18,17:17
*/
public class HPPZ014 {
// 查询
public static final String UPDATE_TIME = "HPPZ014.updateTime";
}
/**
* HPSC003 SQL名称定义
*
* @author:songx
......
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:THppz013.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-03-07 11:17:57 create
*/
public class HPPZ013 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 0.否1.是*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 工厂编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂名称*/
public static final String FIELD_GROUP_TYPE = "groupType"; /* 生产组类型*/
public static final String FIELD_GROUP_CODE = "groupCode"; /* 生产组编码*/
public static final String FIELD_GROUP_NAME = "groupName"; /* 生产组名称*/
public static final String FIELD_USER_ID = "userId"; /* 用户ID*/
public static final String FIELD_USER_NAME = "userName"; /* 用户名称*/
public static final String FIELD_STATUS = "status"; /* 状态:1-在职,2-离职*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 0.否1.是*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂名称*/
public static final String COL_GROUP_TYPE = "GROUP_TYPE"; /* 生产组类型*/
public static final String COL_GROUP_CODE = "GROUP_CODE"; /* 生产组编码*/
public static final String COL_GROUP_NAME = "GROUP_NAME"; /* 生产组名称*/
public static final String COL_USER_ID = "USER_ID"; /* 用户ID*/
public static final String COL_USER_NAME = "USER_NAME"; /* 用户名称*/
public static final String COL_STATUS = "STATUS"; /* 状态:1-在职,2-离职*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String QUERY = "HPPZ013.query";
public static final String COUNT = "HPPZ013.count";
public static final String INSERT = "HPPZ013.insert";
public static final String UPDATE = "HPPZ013.update";
public static final String DELETE = "HPPZ013.delete";
private Long id;
private String companyCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag; /* 0.否1.是*/
private String factoryCode = " "; /* 工厂编码*/
private String factoryName = " "; /* 工厂名称*/
private String groupType = " "; /* 生产组类型*/
private String groupCode = " "; /* 生产组编码*/
private String groupName = " "; /* 生产组名称*/
private String userId = " "; /* 用户ID*/
private String userName = " "; /* 用户名称*/
private Integer status; /* 状态:1-在职,2-离职*/
private String remark = " "; /* 备注*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("工厂名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_TYPE);
eiColumn.setDescName("部门类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_CODE);
eiColumn.setDescName("生产组编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_NAME);
eiColumn.setDescName("生产组名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_ID);
eiColumn.setDescName("用户ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_NAME);
eiColumn.setDescName("用户名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态:1-在职,2-离职");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ013() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码.
*
* @param companyCode - 企业编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0.否1.是.
*
* @param deleteFlag - 0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the factoryCode - 工厂编码.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 工厂编码.
*
* @param factoryCode - 工厂编码
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 工厂名称.
* @return the factoryName
*/
public String getFactoryName() {
return this.factoryName;
}
/**
* set the factoryName - 工厂名称.
*
* @param factoryName - 工厂名称
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
/**
* get the groupType - 部门类型.
* @return the groupType
*/
public String getGroupType() {
return this.groupType;
}
/**
* set the groupType - 部门类型.
*
* @param groupType - 部门类型
*/
public void setGroupType(String groupType) {
this.groupType = groupType;
}
/**
* get the groupCode - 生产组编码.
* @return the groupCode
*/
public String getGroupCode() {
return this.groupCode;
}
/**
* set the groupCode - 生产组编码.
*
* @param groupCode - 生产组编码
*/
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
/**
* get the groupName - 生产组名称.
* @return the groupName
*/
public String getGroupName() {
return this.groupName;
}
/**
* set the groupName - 生产组名称.
*
* @param groupName - 生产组名称
*/
public void setGroupName(String groupName) {
this.groupName = groupName;
}
/**
* get the userId - 用户ID.
* @return the userId
*/
public String getUserId() {
return this.userId;
}
/**
* set the userId - 用户ID.
*
* @param userId - 用户ID
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* get the userName - 用户名称.
* @return the userName
*/
public String getUserName() {
return this.userName;
}
/**
* set the userName - 用户名称.
*
* @param userName - 用户名称
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
* get the status - 状态:1-在职,2-离职.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态:1-在职,2-离职.
*
* @param status - 状态:1-在职,2-离职
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the remark - 备注.
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注.
*
* @param remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setGroupType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_TYPE)), groupType));
setGroupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_CODE)), groupCode));
setGroupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_NAME)), groupName));
setUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_ID)), userId));
setUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_NAME)), userName));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
map.put(FIELD_GROUP_TYPE, StringUtils.toString(groupType, eiMetadata.getMeta(FIELD_GROUP_TYPE)));
map.put(FIELD_GROUP_CODE, StringUtils.toString(groupCode, eiMetadata.getMeta(FIELD_GROUP_CODE)));
map.put(FIELD_GROUP_NAME, StringUtils.toString(groupName, eiMetadata.getMeta(FIELD_GROUP_NAME)));
map.put(FIELD_USER_ID, StringUtils.toString(userId, eiMetadata.getMeta(FIELD_USER_ID)));
map.put(FIELD_USER_NAME, StringUtils.toString(userName, eiMetadata.getMeta(FIELD_USER_NAME)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
return map;
}
}
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:THppz013.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-03-07 11:17:57 create
*/
public class HPPZ01301 extends HPPZ013 {
private static final long serialVersionUID = 1L;
public static final String FIELD_GENDER = "gender"; /* 性别*/
public static final String FIELD_MOBILE = "mobile"; /* 联系方式*/
public static final String COL_GENDER = "GENDER"; /* 性别*/
public static final String COL_MOBILE = "MOBILE"; /* 联系方式*/
private String gender = " "; /* 性别*/
private String mobile = " "; /* 联系方式*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_GENDER);
eiColumn.setDescName("性别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MOBILE);
eiColumn.setDescName("联系方式");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ01301() {
initMetaData();
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setGender(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GENDER)), gender));
setMobile(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MOBILE)), mobile));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_GENDER, StringUtils.toString(gender, eiMetadata.getMeta(FIELD_GENDER)));
map.put(FIELD_MOBILE, StringUtils.toString(mobile, eiMetadata.getMeta(FIELD_MOBILE)));
return map;
}
}
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:THppz013.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-03-07 11:17:57 create
*/
public class HPPZ014 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 0.否1.是*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 工厂编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂名称*/
public static final String FIELD_GROUP_TYPE = "groupType"; /* 生产组类型*/
public static final String FIELD_GROUP_CODE = "groupCode"; /* 生产组编码*/
public static final String FIELD_GROUP_NAME = "groupName"; /* 生产组名称*/
public static final String FIELD_USER_ID = "userId"; /* 用户ID*/
public static final String FIELD_USER_NAME = "userName"; /* 用户名称*/
public static final String FIELD_REG_DATE = "regDate"; /* 登记日期*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 0.否1.是*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂名称*/
public static final String COL_GROUP_TYPE = "GROUP_TYPE"; /* 生产组类型*/
public static final String COL_GROUP_CODE = "GROUP_CODE"; /* 生产组编码*/
public static final String COL_GROUP_NAME = "GROUP_NAME"; /* 生产组名称*/
public static final String COL_USER_ID = "USER_ID"; /* 用户ID*/
public static final String COL_USER_NAME = "USER_NAME"; /* 用户名称*/
public static final String COL_REG_DATE = "REG_DATE"; /* 登记日期*/
public static final String QUERY = "HPPZ014.query";
public static final String COUNT = "HPPZ014.count";
public static final String INSERT = "HPPZ014.insert";
public static final String UPDATE = "HPPZ014.update";
public static final String DELETE = "HPPZ014.delete";
private Long id;
private String companyCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag; /* 0.否1.是*/
private String factoryCode = " "; /* 工厂编码*/
private String factoryName = " "; /* 工厂名称*/
private String groupType = " "; /* 生产组类型*/
private String groupCode = " "; /* 生产组编码*/
private String groupName = " "; /* 生产组名称*/
private String userId = " "; /* 用户ID*/
private String userName = " "; /* 用户名称*/
private String regDate; /* 登记日期*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("工厂名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_TYPE);
eiColumn.setDescName("部门类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_CODE);
eiColumn.setDescName("生产组编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_NAME);
eiColumn.setDescName("生产组名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_ID);
eiColumn.setDescName("用户ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_NAME);
eiColumn.setDescName("用户名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REG_DATE);
eiColumn.setDescName("登记日期");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ014() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码.
*
* @param companyCode - 企业编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0.否1.是.
*
* @param deleteFlag - 0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the factoryCode - 工厂编码.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 工厂编码.
*
* @param factoryCode - 工厂编码
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 工厂名称.
* @return the factoryName
*/
public String getFactoryName() {
return this.factoryName;
}
/**
* set the factoryName - 工厂名称.
*
* @param factoryName - 工厂名称
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
/**
* get the groupType - 部门类型.
* @return the groupType
*/
public String getGroupType() {
return this.groupType;
}
/**
* set the groupType - 部门类型.
*
* @param groupType - 部门类型
*/
public void setGroupType(String groupType) {
this.groupType = groupType;
}
/**
* get the groupCode - 生产组编码.
* @return the groupCode
*/
public String getGroupCode() {
return this.groupCode;
}
/**
* set the groupCode - 生产组编码.
*
* @param groupCode - 生产组编码
*/
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
/**
* get the groupName - 生产组名称.
* @return the groupName
*/
public String getGroupName() {
return this.groupName;
}
/**
* set the groupName - 生产组名称.
*
* @param groupName - 生产组名称
*/
public void setGroupName(String groupName) {
this.groupName = groupName;
}
/**
* get the userId - 用户ID.
* @return the userId
*/
public String getUserId() {
return this.userId;
}
/**
* set the userId - 用户ID.
*
* @param userId - 用户ID
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* get the userName - 用户名称.
* @return the userName
*/
public String getUserName() {
return this.userName;
}
/**
* set the userName - 用户名称.
*
* @param userName - 用户名称
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
* get the remark - 备注.
* @return the remark
*/
public String getRegDate() {
return this.regDate;
}
/**
* set the remark - 备注.
*
* @param regDate - 备注
*/
public void setRegDate(String regDate) {
this.regDate = regDate;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setGroupType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_TYPE)), groupType));
setGroupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_CODE)), groupCode));
setGroupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_NAME)), groupName));
setUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_ID)), userId));
setUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_NAME)), userName));
setRegDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REG_DATE)), regDate));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
map.put(FIELD_GROUP_TYPE, StringUtils.toString(groupType, eiMetadata.getMeta(FIELD_GROUP_TYPE)));
map.put(FIELD_GROUP_CODE, StringUtils.toString(groupCode, eiMetadata.getMeta(FIELD_GROUP_CODE)));
map.put(FIELD_GROUP_NAME, StringUtils.toString(groupName, eiMetadata.getMeta(FIELD_GROUP_NAME)));
map.put(FIELD_USER_ID, StringUtils.toString(userId, eiMetadata.getMeta(FIELD_USER_ID)));
map.put(FIELD_USER_NAME, StringUtils.toString(userName, eiMetadata.getMeta(FIELD_USER_NAME)));
map.put(FIELD_REG_DATE, StringUtils.toString(regDate, eiMetadata.getMeta(FIELD_REG_DATE)));
return map;
}
}
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.Map;
/**
* Project: <br>
* Title:THppz013.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-03-07 11:17:57 create
*/
public class HPPZ01401 extends HPPZ014 {
private static final long serialVersionUID = 1L;
public static final String FIELD_GENDER = "gender"; /* 性别*/
public static final String FIELD_MOBILE = "mobile"; /* 联系方式*/
public static final String COL_GENDER = "GENDER"; /* 性别*/
public static final String COL_MOBILE = "MOBILE"; /* 联系方式*/
private String gender = " "; /* 性别*/
private String mobile = " "; /* 联系方式*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_GENDER);
eiColumn.setDescName("性别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MOBILE);
eiColumn.setDescName("联系方式");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ01401() {
initMetaData();
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setGender(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GENDER)), gender));
setMobile(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MOBILE)), mobile));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_GENDER, StringUtils.toString(gender, eiMetadata.getMeta(FIELD_GENDER)));
map.put(FIELD_MOBILE, StringUtils.toString(mobile, eiMetadata.getMeta(FIELD_MOBILE)));
return map;
}
}
......@@ -9,7 +9,6 @@ import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.RsaUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -17,7 +16,6 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import com.baosight.xservices.xs.constants.LoginConstants;
import java.util.HashMap;
import java.util.List;
......@@ -128,7 +126,8 @@ public class ServiceHPPZ009 extends ServiceBase {
// 此处不能使用DaoUtils方法insert
dao.insert(HPPZ009.INSERT, fPz009);
// 默认新增企业管理员账号
this.initUser(fPz009);
HPXSTools.XsUser.addUser(fPz009.getCompanyCode(), fPz009.getCompanyCode(), fPz009.getCompanyName(),
null, null);
// 关联企业管理员角色
this.insertGroupMember(fPz009);
}
......@@ -171,34 +170,6 @@ public class ServiceHPPZ009 extends ServiceBase {
}
/**
* 初始化用户
*
* @param hppz009
*/
private void initUser(HPPZ009 hppz009) throws Exception {
String companyCode = hppz009.getCompanyCode();
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", companyCode);
inInfoRowMap.put("loginName", companyCode);
inInfoRowMap.put("userName", hppz009.getCompanyName());
// 使用公钥加密密码
String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, companyCode);
inInfoRowMap.put("password", password);
inInfoRowMap.put("rePass", password);
inInfoRowMap.put("email", " ");
inInfoRowMap.put("mobile", " ");
inInfoRowMap.put("companyCode", hppz009.getCompanyCode());
EiInfo inInfo = new EiInfo();
inInfo.addBlock("details").addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XS0102");
inInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 用户关联角色
*
* @param hppz009
......
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.enums.UserStatusEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.pz.domain.HPPZ01301;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 用工管理
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ013 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工管理", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ01301().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工管理", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPPZ013.QUERY, new HPPZ01301());
// 设置用户信息
HPXSTools.XsUser.setUserInfo(inInfo, HPPZ01301.FIELD_USER_ID);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工管理", operType = "新增", operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
this.saveData(resultRows);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
for (Map resultRow : resultRows) {
HPPZ01301 fPz01301 = new HPPZ01301();
fPz01301.fromMap(resultRow);
AssertUtils.isEmpty(fPz01301.getFactoryCode(), "请选择工厂");
AssertUtils.isEmpty(fPz01301.getGroupType(), "请选择生产组类型");
AssertUtils.isEmpty(fPz01301.getGroupCode(), "请选择生产组");
AssertUtils.isEmpty(fPz01301.getUserName(), "请输入姓名");
AssertUtils.isEmpty(fPz01301.getGender(), "请选择性别");
AssertUtils.isEmpty(fPz01301.getMobile(), "请输入联系方式");
}
}
/**
* 保存数据
*
* @param resultRows
*/
private void saveData(List<Map> resultRows) throws Exception {
for (Map resultRow : resultRows) {
HPPZ01301 fPz01301 = new HPPZ01301();
fPz01301.fromMap(resultRow);
// 设置基础信息
this.setBaseInfo(fPz01301);
if (fPz01301.getId() == null || fPz01301.getId() == 0) {
this.add(fPz01301);
} else {
this.modify(fPz01301);
}
}
}
/**
* 设置基础信息
*
* @param fPz01301
*/
private void setBaseInfo(HPPZ01301 fPz01301) {
// 厂区名称
fPz01301.setFactoryName(HPXSTools.XsOrg.get(fPz01301.getFactoryCode()).getOrgCname());
// 组名称
fPz01301.setGroupName(HPXSTools.XsOrg.get(fPz01301.getGroupCode()).getOrgCname());
// 在职状态
if (fPz01301.getStatus() == null) {
fPz01301.setStatus(UserStatusEnum.ONLINE.getCode());
}
}
/**
* 新增数据
*
* @param fPz01301
*/
private void add(HPPZ01301 fPz01301) throws Exception {
// 新增用户信息
String companyCode = UserSessionUtils.getCompanyCode();
String loginPrefix = HPPZTools.HpPz009.getByCode(UserSessionUtils.getCompanyCode()).getLoginPrefix();
String userId = SequenceGenerator.getNextSequence(HPConstant.SequenceId.USER_ID, new String[]{loginPrefix});
HPXSTools.XsUser.addUser(companyCode, userId, fPz01301.getUserName(), fPz01301.getGender(),
fPz01301.getMobile());
fPz01301.setUserId(userId);
fPz01301.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ013.INSERT, fPz01301);
}
/**
* 修改数据
*
* @param fPz01301
*/
private void modify(HPPZ01301 fPz01301) {
DaoUtils.update(HPSqlConstant.HPPZ013.UPDATE_STATUS, fPz01301);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工登记", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPPZ013 fPz013 = new HPPZ013();
fPz013.fromMap(resultRow);
fPz013.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPPZ013.DELETE, fPz013);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
* 用工管理
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ013A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工登记", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.enums.UserStatusEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.pz.domain.HPPZ01301;
import com.baosight.hpjx.hp.pz.domain.HPPZ014;
import com.baosight.hpjx.hp.pz.domain.HPPZ01401;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 用工登记
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ014 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工登记", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ01401().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工登记", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPPZ014.QUERY, new HPPZ01401());
// 设置用户信息
HPXSTools.XsUser.setUserInfo(inInfo, HPPZ01401.FIELD_USER_ID);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 用工登记.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工登记", operType = "新增", operDesc = "用工登记")
public EiInfo checkIn(EiInfo inInfo) {
try {
// 登记日期
Map queryMap = EiInfoUtils.getFirstRow(inInfo, "main");
String regDate = DateUtils.formatShort(queryMap.get("regDate"));
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
this.saveData(resultRows, regDate);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据登记成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "登记失败");
}
return inInfo;
}
/**
* 保存数据
*
* @param resultRows
* @param regDate
*/
private void saveData(List<Map> resultRows, String regDate) {
for (Map resultRow : resultRows) {
HPPZ014 fPz014 = new HPPZ014();
fPz014.fromMap(resultRow);
fPz014.setRegDate(regDate);
// 检查用户是否已登记
Map queryMap = new HashMap();
queryMap.put("factoryCode", fPz014.getFactoryCode());
queryMap.put("groupCode", fPz014.getGroupCode());
queryMap.put("userId", fPz014.getUserId());
queryMap.put("regDate", regDate);
List<HPPZ014> dbHp014s = dao.query(HPPZ014.QUERY, queryMap);
if (CollectionUtils.isEmpty(dbHp014s)) {
// 设置基础信息
this.setBaseInfo(fPz014);
// 写入数据
this.add(fPz014);
} else {
this.modify(fPz014);
}
}
}
/**
* 设置基础信息
*
* @param fPz014
*/
private void setBaseInfo(HPPZ014 fPz014) {
// 厂区名称
fPz014.setFactoryName(HPXSTools.XsOrg.get(fPz014.getFactoryCode()).getOrgCname());
// 组名称
fPz014.setGroupName(HPXSTools.XsOrg.get(fPz014.getGroupCode()).getOrgCname());
}
/**
* 新增数据
*
* @param fPz014
*/
private void add(HPPZ014 fPz014) {
fPz014.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ014.INSERT, fPz014);
}
/**
* 修改
*
* @param fPz014
*/
private void modify(HPPZ014 fPz014) {
DaoUtils.update(HPSqlConstant.HPPZ014.UPDATE_TIME, fPz014);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工登记", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPPZ014 fPz014 = new HPPZ014();
fPz014.fromMap(resultRow);
fPz014.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPPZ014.DELETE, fPz014);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPPZ013">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0.否1.是 -->
FACTORY_CODE as "factoryCode", <!-- 工厂编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
GROUP_TYPE as "groupType", <!-- 部门类型 -->
GROUP_CODE as "groupCode", <!-- 生产组编码 -->
GROUP_NAME as "groupName", <!-- 生产组名称 -->
USER_ID as "userId", <!-- 用户ID -->
USER_NAME as "userName", <!-- 用户名称 -->
STATUS as "status", <!-- 状态:1-在职,2-离职 -->
REMARK as "remark" <!-- 备注 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
GROUP_NAME = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userName">
USER_NAME LIKE CONCAT('%', #userName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="gender">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND GENDER = #gender# )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mobile">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND MOBILE LIKE CONCAT('%', #mobile#, '%'))
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ013">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ013 (
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 0.否1.是 -->
FACTORY_CODE, <!-- 工厂编码 -->
FACTORY_NAME, <!-- 工厂名称 -->
GROUP_TYPE, <!-- 部门类型 -->
GROUP_CODE, <!-- 生产组编码 -->
GROUP_NAME, <!-- 生产组名称 -->
USER_ID, <!-- 用户ID -->
USER_NAME, <!-- 用户名称 -->
STATUS, <!-- 状态:1-在职,2-离职 -->
REMARK <!-- 备注 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #factoryCode#, #factoryName#, #groupType#, #groupCode#,
#groupName#, #userId#, #userName#, #status#, #remark#
)
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPPZ013
SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE ID = #id#
</delete>
<!-- 修改状态 -->
<update id="updateStatus">
UPDATE ${hpjxSchema}.T_HPPZ013
SET
STATUS = #status#, <!-- 状态:1-在职,2-离职 -->
REMARK = #remark#, <!-- 备注 -->
<include refid="updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPPZ014">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0.否1.是 -->
FACTORY_CODE as "factoryCode", <!-- 工厂编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
GROUP_TYPE as "groupType", <!-- 部门类型 -->
GROUP_CODE as "groupCode", <!-- 生产组编码 -->
GROUP_NAME as "groupName", <!-- 生产组名称 -->
USER_ID as "userId", <!-- 用户ID -->
USER_NAME as "userName", <!-- 用户名称 -->
REG_DATE as "regDate" <!-- 登记日期 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
GROUP_NAME = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userName">
USER_NAME LIKE CONCAT('%', #userName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="regDate">
REG_DATE = #regDate#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="gender">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND GENDER = #gender# )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mobile">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND MOBILE LIKE CONCAT('%', #mobile#, '%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="regDateFrom">
REG_DATE &gt;= REPLACE(#regDateFrom#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="regDateTo">
REG_DATE &lt;= REPLACE(#regDateTo#,'-','')
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
REG_DATE DESC, CREATED_TIME DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ014">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ014 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ014 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ014 (
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 0.否1.是 -->
FACTORY_CODE, <!-- 工厂编码 -->
FACTORY_NAME, <!-- 工厂名称 -->
GROUP_TYPE, <!-- 部门类型 -->
GROUP_CODE, <!-- 生产组编码 -->
GROUP_NAME, <!-- 生产组名称 -->
USER_ID, <!-- 用户ID -->
USER_NAME, <!-- 用户名称 -->
REG_DATE <!-- 登记日期 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #factoryCode#, #factoryName#, #groupType#, #groupCode#,
#groupName#, #userId#, #userName#, #regDate#
)
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPPZ014
SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE ID = #id#
</delete>
<!-- 修改 -->
<delete id="update">
UPDATE ${hpjxSchema}.T_HPPZ014
SET
<include refid="updateRevise"/>
WHERE ID = #id#
</delete>
<!-- 修改时间 -->
<delete id="updateTime">
UPDATE ${hpjxSchema}.T_HPPZ014
SET
<include refid="updateRevise"/>
WHERE 1=1
AND FACTORY_CODE = #factoryCode#
AND GROUP_CODE = #groupCode#
AND USER_ID = #userId#
and REG_DATE = #regDate#
</delete>
</sqlMap>
......@@ -8,6 +8,14 @@ import java.io.Serializable;
*/
public class User implements Serializable {
public static final String FIELD_USER_ID = "userId"; /* 用户ID*/
public static final String FIELD_USER_NAME = "userName"; /* 用户中文名*/
public static final String FIELD_LOGIN_NAME = "loginName"; /* 登录ID*/
public static final String FIELD_GENDER = "gender"; /* 性别*/
public static final String FIELD_MOBILE = "mobile"; /* 手机号*/
public static final String FIELD_EMAIL = "email"; /* 邮箱*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业代码*/
/**
* 用户ID
*/
......@@ -24,6 +32,11 @@ public class User implements Serializable {
private String loginName;
/**
* 性别
*/
private String gender;
/**
* 手机号
*/
private String mobile;
......@@ -85,4 +98,12 @@ public class User implements Serializable {
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
}
......@@ -133,14 +133,19 @@
) AS T1,
@LEVEL:=@LEVEL+1 AS LEVEL
FROM ${platSchema}.TXSOG01,
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
<isNotEmpty property="parentOrgId">
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
</isNotEmpty>
<isEmpty property="parentOrgId">
(SELECT @CODES:='root', @LEVEL:= 0) T4
</isEmpty>
WHERE @CODES IS NOT NULL
) T2,
${platSchema}.TXSOG01 T3
LEFT JOIN ${platSchema}.TXSOG01 T5 ON T3.FACTORY_CODE = T5.ORG_ID
WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
AND T3.ORG_TYPE IN ('prodGroup', 'cutGroup', 'factory')
AND T3.ORG_TYPE IN ('prodGroup', 'cutGroup')
<isNotEmpty prepend=" AND " property="orgType">
T3.ORG_TYPE = #orgType#
</isNotEmpty>
......
......@@ -26,6 +26,7 @@
USER_ID as "userId", <!-- 用户id -->
USER_NAME as "userName", <!-- 用户名 -->
LOGIN_NAME as "loginName", <!-- 登录id -->
GENDER as "gender", <!-- 性别 -->
MOBILE as "mobile", <!-- 手机号 -->
EMAIL as "email", <!-- 邮箱 -->
COMPANY_CODE as "companyCode" <!-- 企业编码 -->
......
......@@ -5,12 +5,22 @@ import com.baosight.hpjx.core.enums.OrgTypeEnum;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.RsaUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.xservices.xs.constants.LoginConstants;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
......@@ -61,6 +71,91 @@ public class HPXSTools {
List<User> results = DaoBase.getInstance().query("HPXSUser.query", paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param loginNames
* @return
*/
public static List<User> list(List<String> loginNames) {
if (CollectionUtils.isEmpty(loginNames)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("loginNames", loginNames);
return DaoBase.getInstance().query("HPXSUser.query", queryMap);
}
/**
* 查询
*
* @param loginNames
* @return
*/
public static Map<String, User> map(List<String> loginNames) {
List<User> results = list(loginNames);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(User::getLoginName, item -> item));
}
/**
* 初始化新增用户
*
* @param companyCode
* @param userId
* @param userName
* @param gender
* @param mobile
*/
public static void addUser(String companyCode, String userId, String userName, String gender, String mobile)
throws Exception {
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", userId);
inInfoRowMap.put("loginName", userId);
inInfoRowMap.put("userName", userName);
// 使用公钥加密密码
String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, companyCode);
inInfoRowMap.put("password", password);
inInfoRowMap.put("rePass", password);
inInfoRowMap.put("email", " ");
inInfoRowMap.put("gender", StringUtils.isBlank(gender) ? " " : gender);
inInfoRowMap.put("mobile", StringUtils.isBlank(mobile) ? " " : mobile);
inInfoRowMap.put("companyCode", companyCode);
EiInfo inInfo = new EiInfo();
inInfo.addBlock("details").addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XS0102");
inInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 设置用户信息
*
* @param inInfo
* @param keyName
*/
public static void setUserInfo(EiInfo inInfo, String keyName) {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<String> keyValues = ObjectUtils.listKey(resultRows, keyName);
Map<String, User> resultMap = map(keyValues);
if (MapUtils.isEmpty(resultMap)) {
return;
}
for (Map resultRow : resultRows) {
String keyValue = MapUtils.getString(resultRow, keyName);
User dbUser = resultMap.get(keyValue);
resultRow.put(User.FIELD_USER_NAME, dbUser == null ? "" : dbUser.getUserName());
resultRow.put(User.FIELD_GENDER, dbUser == null ? "" : dbUser.getGender());
resultRow.put(User.FIELD_MOBILE, dbUser == null ? "" : dbUser.getMobile());
resultRow.put(User.FIELD_EMAIL, dbUser == null ? "" : dbUser.getEmail());
}
}
}
/**
......
......@@ -210,11 +210,11 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
*
* @return
*/
public static String formatShort(String dateTime) {
if (StringUtils.isBlank(dateTime)) {
return dateTime;
public static String formatShort(Object dateTime) {
if (ObjectUtils.isNullBlank(dateTime)) {
return dateTime == null ? null : dateTime.toString();
}
return dateTime.replaceAll("-", "")
return dateTime.toString().replaceAll("-", "")
.replaceAll("/", "")
.replaceAll(":", "")
.replaceAll(" ", "");
......
let groupGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "groupCode",
template: function (dataItem) {
for (let i = 0; i < groupGlobalData.length; i++) {
if (groupGlobalData[i]['valueField'] === dataItem['groupCode']) {
return groupGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-parentOrgId", options.model["factoryCode"]);
inInfo.set("inqu_status-0-orgType", options.model["groupType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPXSOrg");
inInfo.set("methodName", "queryGroupComboBox");
inInfo.set("blockId", "group_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}],
loadComplete: function (grid) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
}
}
// 查询
$("#QUERY").on("click", query);
// 用工登记
$("#CHECK_IN").on("click", checkIn);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 生产部门
initGroup();
// 查询
query();
});
/**
* 初始化生产部门
*/
let initGroup = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-parentOrgId", 'root');
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPXSOrg", "queryGroupComboBox", inInfo, {
onSuccess: function (ei) {
groupGlobalData = ei.getBlock("group_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
let item = rows[i];
if (isBlank(item['factoryCode'])) {
message("选中的第" + (i + 1) + "行\"工厂\",不能为空!");
return;
}
if (isBlank(item['groupType'])) {
message("选中的第" + (i + 1) + "行\"部门类型\",不能为空!");
return;
}
if (isBlank(item['groupCode'])) {
message("选中的第" + (i + 1) + "行\"生产部门\",不能为空!");
return;
}
if (isBlank(item['userName'])) {
message("选中的第" + (i + 1) + "行\"姓名\",不能为空!");
return;
}
if (isBlank(item['gender'])) {
message("选中的第" + (i + 1) + "行\"性别\",不能为空!");
return;
}
if (isBlank(item['mobile'])) {
message("选中的第" + (i + 1) + "行\"联系方式\",不能为空!");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ013", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ013", "delete", true);
}
});
}
/**
* 用工登记
*/
let checkIn = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSColorbox.open({
href: "HPPZ013A?methodName=initLoad",
title: "<div style='text-align: center;'>用工登记</div>",
width: "30%",
height: "50%",
callbackName: checkInCallback
});
}
/**
* 登记日期回调
*/
let checkInCallback = function (regDate) {
let inInfo = new EiInfo();
inInfo.set("main-0-regDate", regDate);
JSUtils.submitGridsData("result", "HPPZ014", "checkIn", true,
function (res) {
if (res.status > -1) {
// 关闭弹窗
JSColorbox.close();
}
}, inInfo
);
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="用工管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="部门类型" blockId="inqu_status" ename="groupType" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFSelect>
<EF:EFSelect cname="生产部门" blockId="inqu_status" ename="groupCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="姓名" blockId="inqu_status" ename="userName" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFSelect cname="性别" blockId="inqu_status" ename="gender" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFSelect>
<EF:EFInput cname="联系方式" blockId="inqu_status" ename="mobile" row="0" colWidth="3"/>
<EF:EFSelect cname="状态" blockId="inqu_status" ename="status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="ctdy.hppz.userStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="部门类型" width="80" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="groupCode" cname="生产部门" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="userId" cname="工号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userName" cname="姓名" width="120" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="gender" cname="性别" width="80" align="center" required="true" readonly="true"
valueField="valueField" textField="textField">
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFComboColumn>
<EF:EFColumn ename="mobile" cname="联系方式" width="120" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="status" cname="状态" width="80" align="center" defaultValue="1"
valueField="valueField" textField="textField">
<EF:EFCodeOption codeName="ctdy.hppz.userStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注" width="150"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
// 登记
$("#CONFIRM").on("click", confirm);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 默认当天
$("#inqu_status-0-regDate").val(currDate());
});
/**
* 登记
*/
let confirm = function () {
let regDate = $("#inqu_status-0-regDate").val();
if (isBlank(regDate)) {
message("请选择登记日期");
return;
}
JSUtils.confirm("确定进行\"登记\"操作? ", {
ok: function () {
parent.JSColorbox.setValueCallback(regDate);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage>
<EF:EFRegion id="inqu" title="">
<div class="row">
<EF:EFDatePicker cname="登记日期" blockId="inqu_status" ename="regDate" row="0" colWidth="3" ratio="2:10"
role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true"/>
</div>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [],
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ014", "delete", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="用工记录">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="部门类型" blockId="inqu_status" ename="groupType" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFSelect>
<EF:EFSelect cname="生产部门" blockId="inqu_status" ename="groupCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="姓名" blockId="inqu_status" ename="userName" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFSelect cname="性别" blockId="inqu_status" ename="gender" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFSelect>
<EF:EFInput cname="联系方式" blockId="inqu_status" ename="mobile" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="登记日期(从)" endCname="至" blockId="inqu_status"
startName="regDateFrom" endName="regDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" enable="false" width="110" align="center">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="部门类型" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产部门" enable="false" width="110" align="center">
<EF:EFOptions blockId="group_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="userId" cname="工号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userName" cname="姓名" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="gender" cname="性别" enable="false" width="80" align="center"
valueField="valueField" textField="textField">
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFComboColumn>
<EF:EFColumn ename="mobile" cname="联系方式" enable="false" width="120" align="center"/>
<EF:EFColumn ename="regDate" cname="登记日期" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -197,6 +197,19 @@ function refreshInputSelect(container, inInfo) {
}
/**
* 当前日期 YYYY-MM-DD
*
* @returns {string}
*/
function currDate() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1; // 月份从0开始,需要加1
const day = date.getDate();
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day);
}
/**
* 当前日期 YYYYMMDD
*
* @returns {string}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment