Commit c7b28c54 by liuyang

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

parent 2d475068
......@@ -3,13 +3,11 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
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.HPSC010A;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -32,7 +30,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
@Override
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);
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), new HashMap<String,Object>());
......@@ -50,7 +48,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
if (!startDate.isEmpty()) {
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());
}
......@@ -64,7 +62,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1);
delRows(hpxs010.getId().toString());
delRows(hpxs010.getId());
DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......@@ -115,9 +113,9 @@ public class ServiceHPSC010 extends ServiceEPBase {
//BigDecimal weight = new BigDecimal("0");
for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i);
HPSC008 hpsc008 = new HPSC008();
hpsc008.fromMap(map);
weight = weight+hpsc008.getWeight().doubleValue()+hpsc008.getWeightJh().doubleValue();
HPSC010A hpsc010A = new HPSC010A();
hpsc010A.fromMap(map);
weight = weight+hpsc010A.getWeight().doubleValue()+hpsc010A.getWeightJh().doubleValue();
}
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
hpxs010.fromMap(eiBlock.getRow(0));
......@@ -138,10 +136,10 @@ public class ServiceHPSC010 extends ServiceEPBase {
return inInfo;
}
public void delRows(String id){
HPSC008 hpxs001 = new HPSC008();
hpxs001.setRemark(id);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_REMARK, hpxs001);
public void delRows(Long id){
HPSC010A hpsc010A = new HPSC010A();
hpsc010A.setParentId(id);
hpsc010A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC010A.DELETE_PARENT_ID, hpsc010A);
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.security.UserSessionUtils;
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.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
......@@ -24,10 +25,10 @@ public class ServiceHPSC010A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
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());
EiInfo detailEiInfo = super.query(inInfo, HPSC008.QUERY_DETAIL, new HPSC008());
final EiInfo outEiInfo = super.query(inInfo, HPSC010A.QUERY_RESULT, new HPSC010A());
EiInfo detailEiInfo = super.query(inInfo, HPSC010A.QUERY_DETAIL, new HPSC010A());
EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL);
detailBlock.setBlockMeta(new HPSC008().eiMetadata);
detailBlock.setBlockMeta(new HPSC010A().eiMetadata);
detailBlock.setRows(detailEiInfo.getBlock(EiConstant.resultBlock).getRows());
outEiInfo.setBlock(detailBlock);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
......@@ -47,7 +48,7 @@ public class ServiceHPSC010A extends ServiceEPBase {
if (!startDate.isEmpty()) {
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);
return super.query(inInfo, HPSC008.QUERY,new HPSC008());
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC010A.QUERY,new HPSC010A());
}
}
......@@ -5,10 +5,7 @@ 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.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
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.hp.sc.domain.*;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
......@@ -37,8 +34,8 @@ public class ServiceHPSC096 extends ServiceEPBase {
List<Map> listFactoryCode;
if ("update".equals(methodType)) {
String id = inInfo.getString("inqu_status-0-id");
listFactoryCode = this.dao.query(HPSC008.QUERY,new HashMap<String,Object>(){{
put(HPSC008.FIELD_REMARK,id);
listFactoryCode = this.dao.query(HPSC010A.QUERY,new HashMap<String,Object>(){{
put(HPSC010A.FIELD_PARENT_ID,id);
}},EiConstant.defaultOffset,100);
EiInfo eiInfo = super.query(inInfo,HPSC010.QUERY,new HPSC010());
if (eiInfo.getBlock(EiConstant.resultBlock).getRows().size() >0) {
......@@ -61,16 +58,16 @@ public class ServiceHPSC096 extends ServiceEPBase {
rowNo++;
Map result = new HashMap();
result.putAll(listFactoryCode.get(i));
result.put(HPSC008.FIELD_WEIGHT,0);
result.put(HPSC008.FIELD_WEIGHT_JH,0);
result.put(HPSC008.FIELD_GROUP_TYPE,1);
result.put(HPSC010A.FIELD_WEIGHT,0);
result.put(HPSC010A.FIELD_WEIGHT_JH,0);
result.put(HPSC010A.FIELD_GROUP_TYPE,1);
result.put("rowNo",rowNo);
listResult.add(result);
}else if ("cutGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))){
Map detailMap = new HashMap();
detailMap.putAll(listFactoryCode.get(i));
detailMap.put(HPSC008.FIELD_WEIGHT,0);
detailMap.put(HPSC008.FIELD_WEIGHT_JH,0);
detailMap.put(HPSC010A.FIELD_WEIGHT,0);
detailMap.put(HPSC010A.FIELD_WEIGHT_JH,0);
detailMap.put("rowNo",detrowNo);
listdetail.add(detailMap);
detrowNo++;
......@@ -85,7 +82,7 @@ public class ServiceHPSC096 extends ServiceEPBase {
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_RECORD1_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode());
put(HPSC010A.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode());
}}
);
return inInfo;
......@@ -101,13 +98,13 @@ public class ServiceHPSC096 extends ServiceEPBase {
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPSC008 hpxs002 = new HPSC008();
HPSC010A hpsc010A = new HPSC010A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs002.fromMap(map);
hpxs002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC008.UPDATE, hpxs002);
hpsc010A.fromMap(map);
hpsc010A.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC010A.UPDATE, hpsc010A);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
......@@ -135,16 +132,16 @@ public class ServiceHPSC096 extends ServiceEPBase {
List<Map> listResult = eiBlock.getRows();
listResult.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
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++) {
Map<?, ?> map = listResult.get(i);
hpxs008.fromMap(map);
hpxs008.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs008.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpsc010A.fromMap(map);
hpsc010A.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpsc010A.setDeleteFlag(CommonConstant.YesNo.NO_0);
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.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
......
......@@ -336,7 +336,7 @@ function loadChange(grid,e,field) {
* @param let
*/
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) {
......
......@@ -28,7 +28,7 @@
</EF:EFRegion>
<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="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
......
......@@ -109,7 +109,7 @@ $(function (){
* 确认
*/
$('#confirm').on('click', function () {
let rows = resultGrid.getCheckedRows();
let rows = resultGrid.getDataItems();
if (rows.length < 1) {
message("请选择数据");
return;
......@@ -146,8 +146,8 @@ $(function (){
var info = new EiInfo();
info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val());
info.set("inqu_status-0-registerDate",registerDate);
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("detail"))
info.addBlock(rowsBlock("result"));
info.addBlock(rowsBlock("detail"))
EiCommunicator.send("HPSC010", methodType, info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
......@@ -285,4 +285,40 @@ let detailRefreshRowNo = function (rowNo) {
detailGrid.refresh();
}
}
}
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