Commit f21a06cb by liuyang

2024-10-18

1.生产下料查询数据默认为下料组
2.物料清单保存刷新左侧树形数据
3.生产计划和生产计划详情计划完成完成日期默认为交货日期
parent df46e80f
...@@ -820,9 +820,10 @@ public class HPPZTools { ...@@ -820,9 +820,10 @@ public class HPPZTools {
hpsc002.setProjCode(hpsc001.getProjCode()); hpsc002.setProjCode(hpsc001.getProjCode());
hpsc002.setProjName(hpsc001.getProjName()); hpsc002.setProjName(hpsc001.getProjName());
hpsc002.setParentPrdtName(hpsc001.getProjName()); hpsc002.setParentPrdtName(hpsc001.getProjName());
hpsc002.setDeliveryDate(hpsc001.getDeliveryDate());
hpsc002.setStatus(CommonConstant.YesNo.NO_0); hpsc002.setStatus(CommonConstant.YesNo.NO_0);
hpsc002.setDelStatus(CommonConstant.YesNo.NO_0); hpsc002.setDelStatus(CommonConstant.YesNo.NO_0);
DaoBase.getInstance().insert("HPSC002.insert", hpsc002); DaoBase.getInstance().insert(HPSC002.INSERT, hpsc002);
HPSC002 byProjCode; HPSC002 byProjCode;
if (prdtId_new!=null) if (prdtId_new!=null)
byProjCode = HPSCTools.HpSc002.getByTree2(hpsc002.getProjCode(), prdtId_new.toString()); byProjCode = HPSCTools.HpSc002.getByTree2(hpsc002.getProjCode(), prdtId_new.toString());
...@@ -838,10 +839,11 @@ public class HPPZTools { ...@@ -838,10 +839,11 @@ public class HPPZTools {
hpsc002_lv.setCreatedName(UserSession.getUserId()); hpsc002_lv.setCreatedName(UserSession.getUserId());
hpsc002_lv.setProjCode(hpsc001.getProjCode()); hpsc002_lv.setProjCode(hpsc001.getProjCode());
hpsc002_lv.setProjName(hpsc001.getProjName()); hpsc002_lv.setProjName(hpsc001.getProjName());
hpsc002_lv.setDeliveryDate(hpsc001.getDeliveryDate());
hpsc002_lv.setCreatedTime(sdf.format(new Date())); hpsc002_lv.setCreatedTime(sdf.format(new Date()));
hpsc002_lv.setStatus(CommonConstant.YesNo.NO_0); hpsc002_lv.setStatus(CommonConstant.YesNo.NO_0);
hpsc002_lv.setDelStatus(CommonConstant.YesNo.NO_0); hpsc002_lv.setDelStatus(CommonConstant.YesNo.NO_0);
DaoBase.getInstance().insert("HPSC002.insert", hpsc002_lv); DaoBase.getInstance().insert(HPSC002.INSERT, hpsc002_lv);
} }
} }
} }
......
...@@ -135,11 +135,15 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -135,11 +135,15 @@ public class ServiceHPSC002 extends ServiceBase {
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<String> projectIds = resultRows.stream().map(row -> row.get("projCode").toString()).collect(Collectors.toList());
List<HPSC001> hpsc001s = HPSCTools.HpSc001.queryByCode(projectIds);
// 写入数据 // 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HPSC002 hpsc002 = new HPSC002(); HPSC002 hpsc002 = new HPSC002();
hpsc002.fromMap(resultRows.get(i)); hpsc002.fromMap(resultRows.get(i));
if (hpsc002.getId() == null || hpsc002.getId() == 0) { if (hpsc002.getId() == null || hpsc002.getId() == 0) {
List<HPSC001> hpsc001List = hpsc001s.stream().filter(hpsc001 -> hpsc001.getProjCode().equals(hpsc002.getProjCode())).collect(Collectors.toList());
hpsc002.setDeliveryDate(hpsc001List.get(0).getDeliveryDate());
this.add(hpsc002); this.add(hpsc002);
} else { } else {
this.modify(hpsc002); this.modify(hpsc002);
...@@ -163,16 +167,18 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -163,16 +167,18 @@ public class ServiceHPSC002 extends ServiceBase {
public EiInfo saveDetail(EiInfo inInfo) { public EiInfo saveDetail(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows(); List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
List<String> projectIds = resultRows.stream().map(row -> row.get("projCode").toString()).collect(Collectors.toList());
List<HPSC001> hpsc001s = HPSCTools.HpSc001.queryByCode(projectIds);
// 写入数据 // 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (Map resultRow : resultRows) {
HPSC002 hpsc002 = new HPSC002(); HPSC002 hpsc002 = new HPSC002();
hpsc002.fromMap(resultRows.get(i)); hpsc002.fromMap(resultRow);
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate())); List<HPSC001> hpsc001List = hpsc001s.stream().filter(hpsc001 -> hpsc001.getProjCode().equals(hpsc002.getProjCode())).collect(Collectors.toList());
if (hpsc002.getId() == null || hpsc002.getId() == 0) { if (hpsc002.getId() == null || hpsc002.getId() == 0) {
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate())); hpsc002.setDeliveryDate(hpsc001List.get(0).getDeliveryDate());
inInfo=this.add(hpsc002); inInfo = this.add(hpsc002);
} else { } else {
inInfo=this.modify(hpsc002); inInfo = this.modify(hpsc002);
} }
} }
/* inInfo.setStatus(EiConstant.STATUS_DEFAULT); /* inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -212,7 +218,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -212,7 +218,7 @@ public class ServiceHPSC002 extends ServiceBase {
Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hpsc002.getParentId()); Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hpsc002.getParentId());
hpsc002.setLv(lv.intValue()+1); hpsc002.setLv(lv.intValue()+1);
} }
DaoUtils.insert("HPSC002.insert", hpsc002.toMap()); DaoUtils.insert(HPSC002.INSERT, hpsc002.toMap());
//更新零件后,更新部件重量 //更新零件后,更新部件重量
if(hpsc002.getPrdtType()==3){ if(hpsc002.getPrdtType()==3){
...@@ -346,31 +352,34 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -346,31 +352,34 @@ public class ServiceHPSC002 extends ServiceBase {
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
try { try {
HPSC002 hppz002 = new HPSC002(); HPSC002 hppz002 = new HPSC002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < eiBlock.getRowCount(); i++) { List<String> projectIds = resultRows.stream().map(row -> row.get("projCode").toString()).collect(Collectors.toList());
Map<?, ?> map = eiBlock.getRow(i); List<HPSC001> hpsc001s = HPSCTools.HpSc001.queryByCode(projectIds);
hppz002.fromMap(map); for (Map resultRow : resultRows) {
hppz002.fromMap(resultRow);
hppz002.setLeaf("1"); hppz002.setLeaf("1");
List<HPSC001> hpsc001List = hpsc001s.stream().filter(hpsc001 -> hpsc001.getProjCode().equals(resultRow.get("projCode"))).collect(Collectors.toList());
hppz002.setDeliveryDate(hpsc001List.get(0).getDeliveryDate());
// 计算总重 // 计算总重
BigDecimal num = hppz002.getNum(); BigDecimal num = hppz002.getNum();
BigDecimal unitWt = hppz002.getUnitWt(); BigDecimal unitWt = hppz002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000"); DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()/1000)); BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue() / 1000));
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue()); hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hppz002.setTotalWt(totalWt); hppz002.setTotalWt(totalWt);
// if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) { // if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
// hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName()); // hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
// } // }
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick())); hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(), hppz002.getWidth(), hppz002.getThick()));
if(hppz002.getParentId().equals("root")){ if (hppz002.getParentId().equals("root")) {
hppz002.setLv(new Integer(1)); hppz002.setLv(new Integer(1));
}else{ } else {
hppz002.setPrdtCode(HPPZTools.HpPz004.checkAndSave(hppz002.getPrdtType(),hppz002.getPrdtName())); hppz002.setPrdtCode(HPPZTools.HpPz004.checkAndSave(hppz002.getPrdtType(), hppz002.getPrdtName()));
Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hppz002.getParentId()); Integer lv = (Integer) this.dao.get("HPSC002.queryLv", "id", hppz002.getParentId());
hppz002.setLv(lv.intValue()+1); hppz002.setLv(lv.intValue() + 1);
} }
DaoUtils.insert("HPSC002.insert", hppz002.toMap()); DaoUtils.insert(HPSC002.INSERT, hppz002.toMap());
if (!hppz002.getParentId().equals("root")) { if (!hppz002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(hppz002.getParentId()); this.checkTreeNodeLeaf(hppz002.getParentId());
...@@ -864,8 +873,8 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -864,8 +873,8 @@ public class ServiceHPSC002 extends ServiceBase {
newSc004.setParentId(planNo); newSc004.setParentId(planNo);
newSc004.setMatId(dbSc002Child.getId()); newSc004.setMatId(dbSc002Child.getId());
newSc004.setFilePath1(dbSc002Child.getId().toString()); newSc004.setFilePath1(dbSc002Child.getId().toString());
newSc004.setPlanCompletionDate(dbSc002Child.getDeliveryDate()); newSc004.setPlanCompletionDate(dbSc002.getDeliveryDate());
newSc004.setPlanCommentDate(dbSc002Child.getDeliveryDate()); newSc004.setPlanCommentDate(dbSc002.getDeliveryDate());
newSc004.setDelStatus(CommonConstant.YesNo.NO_0); newSc004.setDelStatus(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPSC004.INSERT, newSc004); DaoUtils.insert(HPSC004.INSERT, newSc004);
} }
......
...@@ -5,6 +5,7 @@ import com.baosight.hpjx.common.DdynamicEnum; ...@@ -5,6 +5,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.HPConstants; import com.baosight.hpjx.common.HPConstants;
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.enums.OrgTypeEnum;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002; import com.baosight.hpjx.hp.ds.domain.HPDS002;
...@@ -105,6 +106,11 @@ public class ServiceHPSC0061 extends ServiceBase { ...@@ -105,6 +106,11 @@ public class ServiceHPSC0061 extends ServiceBase {
public EiInfo queryDetail(EiInfo inInfo) { public EiInfo queryDetail(EiInfo inInfo) {
try { try {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
List<Map> list = HPXSTools.XsOrg.queryParent(null, OrgTypeEnum.CUT_GROUP.getCode());
if (!CollectionUtils.isEmpty(list)){
List<String> orgIds = list.stream().map(m -> m.get("orgId").toString()).collect(Collectors.toList());
queryMap.put("groupCodes", orgIds);
}
queryMap.put("prodOrderNo", inInfo.getString("prodOrderNo")); queryMap.put("prodOrderNo", inInfo.getString("prodOrderNo"));
List<HPSC0061> dbSc0061s = dao.query("HPSC0061.queryDetail", queryMap); List<HPSC0061> dbSc0061s = dao.query("HPSC0061.queryDetail", queryMap);
inInfo.addBlock(CommonConstant.Field.DETAIL).setRows(dbSc0061s); inInfo.addBlock(CommonConstant.Field.DETAIL).setRows(dbSc0061s);
......
...@@ -169,13 +169,16 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -169,13 +169,16 @@ public class ServiceHPSC102 extends ServiceEPBase {
public EiInfo saveDetail(EiInfo inInfo) { public EiInfo saveDetail(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows(); List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
List<String> projectIds = resultRows.stream().map(row -> row.get("projCode").toString()).collect(Collectors.toList());
List<HPSC001> hpsc001s = HPSCTools.HpSc001.queryByCode(projectIds);
// 写入数据 // 写入数据
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HPSC002 hpsc002 = new HPSC002(); HPSC002 hpsc002 = new HPSC002();
hpsc002.fromMap(resultRow); hpsc002.fromMap(resultRow);
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate())); List<HPSC001> hpsc001List = hpsc001s.stream().filter(hpsc001 -> hpsc001.getProjCode().equals(resultRow.get("projCode"))).collect(Collectors.toList());
hpsc002.setDeliveryDate(hpsc001List.get(0).getDeliveryDate());
if (hpsc002.getId() == null || hpsc002.getId() == 0) { if (hpsc002.getId() == null || hpsc002.getId() == 0) {
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate())); hpsc002.setDeliveryDate(hpsc001List.get(0).getDeliveryDate());
inInfo = this.add(hpsc002); inInfo = this.add(hpsc002);
} else { } else {
inInfo = this.modify(hpsc002); inInfo = this.modify(hpsc002);
...@@ -344,29 +347,32 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -344,29 +347,32 @@ public class ServiceHPSC102 extends ServiceEPBase {
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
try { try {
HPSC002 hppz002 = new HPSC002(); HPSC002 hppz002 = new HPSC002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < eiBlock.getRowCount(); i++) { List<String> projectIds = resultRows.stream().map(row -> row.get("projCode").toString()).collect(Collectors.toList());
Map<?, ?> map = eiBlock.getRow(i); List<HPSC001> hpsc001s = HPSCTools.HpSc001.queryByCode(projectIds);
hppz002.fromMap(map); for (Map resultRow : resultRows) {
hppz002.fromMap(resultRow);
hppz002.setLeaf("1"); hppz002.setLeaf("1");
List<HPSC001> hpsc001List = hpsc001s.stream().filter(hpsc001 -> hpsc001.getProjCode().equals(resultRow.get("projCode"))).collect(Collectors.toList());
hppz002.setDeliveryDate(hpsc001List.get(0).getDeliveryDate());
// 计算总重 // 计算总重
BigDecimal num = hppz002.getNum(); BigDecimal num = hppz002.getNum();
BigDecimal unitWt = hppz002.getUnitWt(); BigDecimal unitWt = hppz002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000"); DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()/1000)); BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue() / 1000));
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue()); hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hppz002.setTotalWt(totalWt); hppz002.setTotalWt(totalWt);
// if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) { // if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
// hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName()); // hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
// } // }
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick())); hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(), hppz002.getWidth(), hppz002.getThick()));
if(hppz002.getParentId().equals("root")){ if (hppz002.getParentId().equals("root")) {
hppz002.setLv(new Integer(1)); hppz002.setLv(new Integer(1));
}else{ } else {
hppz002.setPrdtCode(HPPZTools.HpPz004.checkAndSave(hppz002.getPrdtType(),hppz002.getPrdtName())); hppz002.setPrdtCode(HPPZTools.HpPz004.checkAndSave(hppz002.getPrdtType(), hppz002.getPrdtName()));
Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hppz002.getParentId()); Integer lv = (Integer) this.dao.get("HPSC002.queryLv", "id", hppz002.getParentId());
hppz002.setLv(lv.intValue()+1); hppz002.setLv(lv.intValue() + 1);
} }
DaoUtils.insert(HPSC002.INSERT, hppz002.toMap()); DaoUtils.insert(HPSC002.INSERT, hppz002.toMap());
...@@ -883,8 +889,8 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -883,8 +889,8 @@ public class ServiceHPSC102 extends ServiceEPBase {
newSc004.setParentId(planNo); newSc004.setParentId(planNo);
newSc004.setMatId(dbSc002Child.getId()); newSc004.setMatId(dbSc002Child.getId());
newSc004.setFilePath1(dbSc002Child.getId().toString()); newSc004.setFilePath1(dbSc002Child.getId().toString());
newSc004.setPlanCompletionDate(dbSc002Child.getDeliveryDate()); newSc004.setPlanCompletionDate(hpsc002.getDeliveryDate());
newSc004.setPlanCommentDate(dbSc002Child.getDeliveryDate()); newSc004.setPlanCommentDate(hpsc002.getDeliveryDate());
newSc004.setFactoryCode(org.getOrgId()); newSc004.setFactoryCode(org.getOrgId());
newSc004.setProdOrderNo(prodOrderNo); newSc004.setProdOrderNo(prodOrderNo);
newSc004.setDelStatus(CommonConstant.YesNo.NO_0); newSc004.setDelStatus(CommonConstant.YesNo.NO_0);
......
...@@ -91,8 +91,11 @@ ...@@ -91,8 +91,11 @@
B.GROUP_NAME as "groupName", B.GROUP_NAME as "groupName",
IFNULL(B.COMPLETE_STATUS, 0) as "completeStatus" IFNULL(B.COMPLETE_STATUS, 0) as "completeStatus"
FROM ${hpjxSchema}.T_HPSC0061A A FROM ${hpjxSchema}.T_HPSC0061A A
LEFT JOIN ${hpjxSchema}.T_HPSC0061 B LEFT JOIN ${hpjxSchema}.T_HPSC0061 B ON A.INVENT_CODE = B.INVENT_CODE
ON A.INVENT_CODE = B.INVENT_CODE AND B.PROD_ORDER_NO = #prodOrderNo# WHERE B.PROD_ORDER_NO = #prodOrderNo#
<isNotEmpty prepend=" AND " property="groupCodes">
B.GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate>
</isNotEmpty>
ORDER BY A.INVENT_CODE ASC ORDER BY A.INVENT_CODE ASC
</select> </select>
...@@ -102,6 +105,10 @@ ...@@ -102,6 +105,10 @@
LEFT JOIN ${hpjxSchema}.T_HPSC0061 B LEFT JOIN ${hpjxSchema}.T_HPSC0061 B
ON A.INVENT_CODE = B.INVENT_CODE ON A.INVENT_CODE = B.INVENT_CODE
WHERE B.PROD_ORDER_NO = #prodOrderNo# WHERE B.PROD_ORDER_NO = #prodOrderNo#
<isNotEmpty prepend=" AND " property="groupCode">
B.GROUP_CODE = #groupCode#
</isNotEmpty>
</select> </select>
<insert id="insert"> <insert id="insert">
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME desc REGISTER_DATE desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME desc REGISTER_DATE desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME desc REGISTER_DATE desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
A.FACTORY_CODE,B.SORT_INDEX ASC A.FACTORY_CODE
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -443,14 +443,6 @@ ...@@ -443,14 +443,6 @@
GROUP_TYPE = #groupType# GROUP_TYPE = #groupType#
</isNotEmpty> </isNotEmpty>
GROUP BY USER_ID,USER_NAME,FACTORY_CODE,FACTORY_NAME,GROUP_CODE,GROUP_NAME GROUP BY USER_ID,USER_NAME,FACTORY_CODE,FACTORY_NAME,GROUP_CODE,GROUP_NAME
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select> </select>
...@@ -487,7 +479,7 @@ ...@@ -487,7 +479,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
A.FACTORY_CODE,B.SORT_INDEX ASC A.FACTORY_CODE
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -271,16 +271,19 @@ public class HPXSTools { ...@@ -271,16 +271,19 @@ public class HPXSTools {
* @return * @return
*/ */
public static List<Map> queryParent(String orgId,String orgType) { public static List<Map> queryParent(String orgId,String orgType) {
AssertUtils.isNull(orgId, "组织ID不能为空"); //AssertUtils.isNull(orgId, "组织ID不能为空");
AssertUtils.isNull(orgType, "组织类型不能为空"); AssertUtils.isNull(orgType, "组织类型不能为空");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
if (StringUtils.isNotNull(orgId)){
queryMap.put("parentOrgId", orgId); queryMap.put("parentOrgId", orgId);
}
queryMap.put("orgType", orgType); queryMap.put("orgType", orgType);
List<Map> results = DaoBase.getInstance().query("HPXSOrg.queryGroupComboBox", queryMap); List<Map> results = DaoBase.getInstance().query("HPXSOrg.queryGroupComboBox", queryMap);
AssertUtils.isEmpty(results, String.format("组织[%s]不存在父级信息", orgId));
return results; //AssertUtils.isEmpty(results, String.format("组织[%s]不存在父级信息", orgId));
return CollectionUtils.isEmpty(results)? new ArrayList<>():results;
} }
/** /**
......
...@@ -744,6 +744,22 @@ function saveFunc() { ...@@ -744,6 +744,22 @@ function saveFunc() {
JSUtils.submitGridsData("result", "HPSC002", "save", JSUtils.submitGridsData("result", "HPSC002", "save",
true, function (res) { true, function (res) {
if (res.status > -1) { if (res.status > -1) {
const tree = $("#materialTree").data("kendoTreeView");
var selectedNode = tree.select();
tree.append({ // append()selecttedNode
nodeId: rows[0].id,
label: rows[0].id,
text: rows[0].prdtName,
pId : rows[0].parentId,
prdtCode: rows[0].prdtCode,
prdtName: rows[0].prdtName,
projCode: rows[0].projCode,
projName: rows[0].projName,
deliveryDate: rows[0].deliveryDate,
lv: rows[0].lv
}, selectedNode);
tree.reload(rows[0].parentId)
expandTreeNode(tree, rows[0].parentId);
refreshTree(); refreshTree();
} }
} }
...@@ -758,15 +774,32 @@ function saveFunc() { ...@@ -758,15 +774,32 @@ function saveFunc() {
*/ */
let refreshTree = function () { let refreshTree = function () {
setTimeout(() => { setTimeout(() => {
const selectTreeNode = (tree, treeOrgId) => {
if (!tree || treeOrgId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeOrgId);
if (barDataItem) {
let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点
tree.select(barElement);
setTreeNodeValue(barDataItem)
} else {
selectTreeNode(tree, treeOrgId)
}
}, 100)
}
// 刷新树节点 // 刷新树节点
const tree = $("#materialTree").data("kendoTreeView"); const tree = $("#materialTree").data("kendoTreeView");
// 选中的节点 // 选中的节点
const treeId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId; const treeOrgId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
tree.reload(treeId) tree.reload(treeOrgId)
// 展开成功后选中对应的树节点 expandTreeNode(tree, treeOrgId)
expandTreeNode(tree, treeId); // tree.expandPath(treeOrgId)
// 展开成功后选中对应的树节点 // 展开成功后选中对应的树节点
selectTreeNode(tree, treeId); selectTreeNode(tree, treeOrgId);
}, 500); }, 500);
} }
......
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