Commit c7b28c54 by liuyang

2024-04-10 报工管理功能优化

parent 2d475068
...@@ -3,13 +3,11 @@ package com.baosight.hpjx.hp.sc.service; ...@@ -3,13 +3,11 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC009;
import com.baosight.hpjx.hp.sc.domain.HPSC010; import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.hp.sc.domain.HPSC010A;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils; import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.hpjx.util.contants.ACConstants; import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -32,7 +30,7 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -32,7 +30,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC009.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC010.QUERY, new HPSC010().eiMetadata); final EiInfo outEiInfo = super.query(inInfo, HPSC010.QUERY, new HPSC010().eiMetadata);
CommonMethod.initBlock(outEiInfo, CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), new HashMap<String,Object>()); Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), new HashMap<String,Object>());
...@@ -50,7 +48,7 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -50,7 +48,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
if (!startDate.isEmpty()) { if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate)); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
} }
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo,HPSC010.QUERY,new HPSC010()); return super.query(inInfo,HPSC010.QUERY,new HPSC010());
} }
...@@ -64,7 +62,7 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -64,7 +62,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map); hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1); hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1);
delRows(hpxs010.getId().toString()); delRows(hpxs010.getId());
DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap()); DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
...@@ -115,9 +113,9 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -115,9 +113,9 @@ public class ServiceHPSC010 extends ServiceEPBase {
//BigDecimal weight = new BigDecimal("0"); //BigDecimal weight = new BigDecimal("0");
for (i = 0; i < list.size(); i++) { for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i); Map<?, ?> map = list.get(i);
HPSC008 hpsc008 = new HPSC008(); HPSC010A hpsc010A = new HPSC010A();
hpsc008.fromMap(map); hpsc010A.fromMap(map);
weight = weight+hpsc008.getWeight().doubleValue()+hpsc008.getWeightJh().doubleValue(); weight = weight+hpsc010A.getWeight().doubleValue()+hpsc010A.getWeightJh().doubleValue();
} }
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE); String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
hpxs010.fromMap(eiBlock.getRow(0)); hpxs010.fromMap(eiBlock.getRow(0));
...@@ -138,10 +136,10 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -138,10 +136,10 @@ public class ServiceHPSC010 extends ServiceEPBase {
return inInfo; return inInfo;
} }
public void delRows(String id){ public void delRows(Long id){
HPSC008 hpxs001 = new HPSC008(); HPSC010A hpsc010A = new HPSC010A();
hpxs001.setRemark(id); hpsc010A.setParentId(id);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1); hpsc010A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_REMARK, hpxs001); DaoUtils.update(HPSC010A.DELETE_PARENT_ID, hpsc010A);
} }
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import com.baosight.hpjx.common.DdynamicEnum; ...@@ -4,6 +4,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008; import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC010A;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants; import com.baosight.hpjx.util.contants.ACConstants;
...@@ -24,10 +25,10 @@ public class ServiceHPSC010A extends ServiceEPBase { ...@@ -24,10 +25,10 @@ public class ServiceHPSC010A extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC008.QUERY_RESULT, new HPSC008()); final EiInfo outEiInfo = super.query(inInfo, HPSC010A.QUERY_RESULT, new HPSC010A());
EiInfo detailEiInfo = super.query(inInfo, HPSC008.QUERY_DETAIL, new HPSC008()); EiInfo detailEiInfo = super.query(inInfo, HPSC010A.QUERY_DETAIL, new HPSC010A());
EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL); EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL);
detailBlock.setBlockMeta(new HPSC008().eiMetadata); detailBlock.setBlockMeta(new HPSC010A().eiMetadata);
detailBlock.setRows(detailEiInfo.getBlock(EiConstant.resultBlock).getRows()); detailBlock.setRows(detailEiInfo.getBlock(EiConstant.resultBlock).getRows());
outEiInfo.setBlock(detailBlock); outEiInfo.setBlock(detailBlock);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false); CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
...@@ -47,7 +48,7 @@ public class ServiceHPSC010A extends ServiceEPBase { ...@@ -47,7 +48,7 @@ public class ServiceHPSC010A extends ServiceEPBase {
if (!startDate.isEmpty()) { if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate)); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
} }
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC008.QUERY,new HPSC008()); return super.query(inInfo, HPSC010A.QUERY,new HPSC010A());
} }
} }
...@@ -5,10 +5,7 @@ import com.baosight.hpjx.common.DdynamicEnum; ...@@ -5,10 +5,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008; import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.hp.sc.domain.HPSC096;
import com.baosight.hpjx.hp.sc.domain.HPSC098;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils; import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
...@@ -37,8 +34,8 @@ public class ServiceHPSC096 extends ServiceEPBase { ...@@ -37,8 +34,8 @@ public class ServiceHPSC096 extends ServiceEPBase {
List<Map> listFactoryCode; List<Map> listFactoryCode;
if ("update".equals(methodType)) { if ("update".equals(methodType)) {
String id = inInfo.getString("inqu_status-0-id"); String id = inInfo.getString("inqu_status-0-id");
listFactoryCode = this.dao.query(HPSC008.QUERY,new HashMap<String,Object>(){{ listFactoryCode = this.dao.query(HPSC010A.QUERY,new HashMap<String,Object>(){{
put(HPSC008.FIELD_REMARK,id); put(HPSC010A.FIELD_PARENT_ID,id);
}},EiConstant.defaultOffset,100); }},EiConstant.defaultOffset,100);
EiInfo eiInfo = super.query(inInfo,HPSC010.QUERY,new HPSC010()); EiInfo eiInfo = super.query(inInfo,HPSC010.QUERY,new HPSC010());
if (eiInfo.getBlock(EiConstant.resultBlock).getRows().size() >0) { if (eiInfo.getBlock(EiConstant.resultBlock).getRows().size() >0) {
...@@ -61,16 +58,16 @@ public class ServiceHPSC096 extends ServiceEPBase { ...@@ -61,16 +58,16 @@ public class ServiceHPSC096 extends ServiceEPBase {
rowNo++; rowNo++;
Map result = new HashMap(); Map result = new HashMap();
result.putAll(listFactoryCode.get(i)); result.putAll(listFactoryCode.get(i));
result.put(HPSC008.FIELD_WEIGHT,0); result.put(HPSC010A.FIELD_WEIGHT,0);
result.put(HPSC008.FIELD_WEIGHT_JH,0); result.put(HPSC010A.FIELD_WEIGHT_JH,0);
result.put(HPSC008.FIELD_GROUP_TYPE,1); result.put(HPSC010A.FIELD_GROUP_TYPE,1);
result.put("rowNo",rowNo); result.put("rowNo",rowNo);
listResult.add(result); listResult.add(result);
}else if ("cutGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))){ }else if ("cutGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))){
Map detailMap = new HashMap(); Map detailMap = new HashMap();
detailMap.putAll(listFactoryCode.get(i)); detailMap.putAll(listFactoryCode.get(i));
detailMap.put(HPSC008.FIELD_WEIGHT,0); detailMap.put(HPSC010A.FIELD_WEIGHT,0);
detailMap.put(HPSC008.FIELD_WEIGHT_JH,0); detailMap.put(HPSC010A.FIELD_WEIGHT_JH,0);
detailMap.put("rowNo",detrowNo); detailMap.put("rowNo",detrowNo);
listdetail.add(detailMap); listdetail.add(detailMap);
detrowNo++; detrowNo++;
...@@ -85,7 +82,7 @@ public class ServiceHPSC096 extends ServiceEPBase { ...@@ -85,7 +82,7 @@ public class ServiceHPSC096 extends ServiceEPBase {
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_RECORD1_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID), Arrays.asList(DdynamicEnum.GROUP_RECORD1_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{ new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode()); put(HPSC010A.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode());
}} }}
); );
return inInfo; return inInfo;
...@@ -101,13 +98,13 @@ public class ServiceHPSC096 extends ServiceEPBase { ...@@ -101,13 +98,13 @@ public class ServiceHPSC096 extends ServiceEPBase {
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
int i = 0; int i = 0;
try { try {
HPSC008 hpxs002 = new HPSC008(); HPSC010A hpsc010A = new HPSC010A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) { for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpxs002.fromMap(map); hpsc010A.fromMap(map);
hpxs002.setDeleteFlag(CommonConstant.YesNo.NO_0); hpsc010A.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC008.UPDATE, hpxs002); DaoUtils.update(HPSC010A.UPDATE, hpsc010A);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
...@@ -135,16 +132,16 @@ public class ServiceHPSC096 extends ServiceEPBase { ...@@ -135,16 +132,16 @@ public class ServiceHPSC096 extends ServiceEPBase {
List<Map> listResult = eiBlock.getRows(); List<Map> listResult = eiBlock.getRows();
listResult.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows()); listResult.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE); String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
HPSC008 hpxs008 = new HPSC008(); HPSC010A hpsc010A = new HPSC010A();
for (i = 0; i < listResult.size(); i++) { for (i = 0; i < listResult.size(); i++) {
Map<?, ?> map = listResult.get(i); Map<?, ?> map = listResult.get(i);
hpxs008.fromMap(map); hpsc010A.fromMap(map);
hpxs008.setRegisterDate(StringUtil.removeHorizontalLine(registerDate)); hpsc010A.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs008.setDeleteFlag(CommonConstant.YesNo.NO_0); hpsc010A.setDeleteFlag(CommonConstant.YesNo.NO_0);
for (Map map1:list) { for (Map map1:list) {
hpxs008.setRemark(map1.get(HPSC010.FIELD_ID).toString()); hpsc010A.setParentId((Long) map1.get(HPSC010.FIELD_ID));
} }
DaoUtils.insert(HPSC008.INSERT, hpxs008); DaoUtils.insert(HPSC010A.INSERT, hpsc010A);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
......
...@@ -336,7 +336,7 @@ function loadChange(grid,e,field) { ...@@ -336,7 +336,7 @@ function loadChange(grid,e,field) {
* @param let * @param let
*/ */
function showGroupDetail(id) { function showGroupDetail(id) {
window.open("HPSC010A?methodName=initLoad&inqu_status-0-remark=" + id+"&efParentFormEname=HPSC011") window.open("HPSC010A?methodName=initLoad&inqu_status-0-parentId=" + id+"&efParentFormEname=HPSC010")
} }
function addWindowOpen(id) { function addWindowOpen(id) {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/> <EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
......
...@@ -109,7 +109,7 @@ $(function (){ ...@@ -109,7 +109,7 @@ $(function (){
* 确认 * 确认
*/ */
$('#confirm').on('click', function () { $('#confirm').on('click', function () {
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getDataItems();
if (rows.length < 1) { if (rows.length < 1) {
message("请选择数据"); message("请选择数据");
return; return;
...@@ -146,8 +146,8 @@ $(function (){ ...@@ -146,8 +146,8 @@ $(function (){
var info = new EiInfo(); var info = new EiInfo();
info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val()); info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val());
info.set("inqu_status-0-registerDate",registerDate); info.set("inqu_status-0-registerDate",registerDate);
info.addBlock(JSUtils.checkedRows2Block("result")); info.addBlock(rowsBlock("result"));
info.addBlock(JSUtils.checkedRows2Block("detail")) info.addBlock(rowsBlock("detail"))
EiCommunicator.send("HPSC010", methodType, info, { EiCommunicator.send("HPSC010", methodType, info, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
...@@ -286,3 +286,39 @@ let detailRefreshRowNo = function (rowNo) { ...@@ -286,3 +286,39 @@ let detailRefreshRowNo = function (rowNo) {
} }
} }
} }
var rowsBlock = function (grid_id) {
var resultGrid = window[grid_id + 'Grid'];
var columns = resultGrid.columns;
var dateColumns = _.filter(columns,
function (column) {
return column.editType === "date"
|| column.editType === "datetime";
}
);
var eiblock = new EiBlock(grid_id);
var rowsDate = resultGrid.getDataItems();
for (var int = 0; int < rowsDate.length; int++) {
if (int == 0) {
for (var key in rowsDate[0].toJSON()) {
var eColumn = new EiColumn(key);
eiblock.getBlockMeta().addMeta(eColumn);
}
}
var model = rowsDate[int];
$.each(dateColumns, function (index, dateColumn) {
var field = dateColumn.field, dateFormat = dateColumn.dateFormat;
model[field] = kendo.toString(model[field],
dateFormat
);// 日期转String
});
eiblock.addRow(eiblock.getMappedArray(model, true));
}
var showCount = eiblock.get(EiConstant.SHOW_COUNT) || "true";
eiblock.set(EiConstant.SHOW_COUNT, showCount);
eiblock.set(EiConstant.LIMIT, resultGrid.dataSource['_pageSize']);
// eiblock.set(EiConstant.OFFSET, resultGrid.dataSource['_skip']);
// 默认查询第一页
eiblock.set(EiConstant.OFFSET, 0);
return eiblock;
}
\ No newline at end of file
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