Commit 7b878a56 by lyy

Merge branch 'dev' of http://129.211.46.84:8800/platform/hp-smart into dev-sx

parents c331022a f21a06cb
...@@ -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,38 +352,41 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -346,38 +352,41 @@ 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.setLeaf("1"); hppz002.fromMap(resultRow);
// 计算总重 hppz002.setLeaf("1");
BigDecimal num = hppz002.getNum(); List<HPSC001> hpsc001List = hpsc001s.stream().filter(hpsc001 -> hpsc001.getProjCode().equals(resultRow.get("projCode"))).collect(Collectors.toList());
BigDecimal unitWt = hppz002.getUnitWt(); hppz002.setDeliveryDate(hpsc001List.get(0).getDeliveryDate());
DecimalFormat decimalFormat = new DecimalFormat("#.000"); // 计算总重
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()/1000)); BigDecimal num = hppz002.getNum();
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue()); BigDecimal unitWt = hppz002.getUnitWt();
hppz002.setTotalWt(totalWt); DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue() / 1000));
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
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());
} }
//处理项目管理中物料状态 //处理项目管理中物料状态
HPSCTools.updateProjStatus(hppz002.getProjCode()); HPSCTools.updateProjStatus(hppz002.getProjCode());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!"); inInfo.setMsg("新增成功!");
...@@ -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();
queryMap.put("parentOrgId", orgId); if (StringUtils.isNotNull(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();
} }
} }
...@@ -757,17 +773,34 @@ function saveFunc() { ...@@ -757,17 +773,34 @@ function saveFunc() {
* 刷新树 * 刷新树
*/ */
let refreshTree = function () { let refreshTree = function () {
setTimeout(() => { setTimeout(() => {
// 刷新树节点 const selectTreeNode = (tree, treeOrgId) => {
const tree = $("#materialTree").data("kendoTreeView"); if (!tree || treeOrgId == null) {
// 选中的节点 return
const treeId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId; }
tree.reload(treeId) setTimeout(() => {
// 展开成功后选中对应的树节点 let barDataItem = tree.dataSource.get(treeOrgId);
expandTreeNode(tree, treeId); if (barDataItem) {
// 展开成功后选中对应的树节点 let barElement = tree.findByUid(barDataItem.uid);
selectTreeNode(tree, treeId); // 刷新完成后选中对应的树节点
}, 500); tree.select(barElement);
setTreeNodeValue(barDataItem)
} else {
selectTreeNode(tree, treeOrgId)
}
}, 100)
}
// 刷新树节点
const tree = $("#materialTree").data("kendoTreeView");
// 选中的节点
const treeOrgId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
tree.reload(treeOrgId)
expandTreeNode(tree, treeOrgId)
// tree.expandPath(treeOrgId)
// 展开成功后选中对应的树节点
selectTreeNode(tree, treeOrgId);
}, 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