| | |
| | | |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.data.BaseResp; |
| | | import com.fzzy.igds.data.PledgeReminders; |
| | | import com.fzzy.igds.domain.InoutNoticeIn; |
| | | import com.fzzy.igds.domain.InoutNoticeOut; |
| | | import com.fzzy.igds.domain.PledgeContract; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.DecimalFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Desc: å·¥åä¸å¡æ¥å£ |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class BizWorkService { |
| | | |
| | | @Resource |
| | | private WorkOrderConfService confService; |
| | | @Resource |
| | |
| | | |
| | | /** |
| | | * è·åæµç¨é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param deptId åºåºID |
| | | * @param type ä¸å¡ç±»å |
| | | * @param type ä¸å¡ç±»å |
| | | * @return é
ç½®ä¿¡æ¯ |
| | | */ |
| | | public WorkOrderConf getConfByDeptId(String deptId, WorkBizType type) { |
| | |
| | | /** |
| | | * |
| | | * æ ¹æ®åºå
¥åºéç¥åå¯å¨å®¡æ¹å·¥å |
| | | * |
| | | * @param data åºå
¥åºå·¥åæ°æ® |
| | | * @return ååºç»æ |
| | | */ |
| | |
| | | work.setDeptId(data.getDeptId()); |
| | | work.setCompanyId(data.getCompanyId()); |
| | | work.setUpdateTime(new Date()); |
| | | work.setTitle(data.getName()+"-审æ¹"); |
| | | work.setTitle(data.getName() + "-审æ¹"); |
| | | work.setConfId(conf.getId()); |
| | | work.setStatus(WorkStatus.STATUS_30.getCode()); |
| | | work.setReceiveTime(new Date()); |
| | |
| | | /** |
| | | * |
| | | * æ ¹æ®åºåºåºéç¥åå¯å¨å®¡æ¹å·¥å |
| | | * |
| | | * @param data åºå
¥åºå·¥åæ°æ® |
| | | * @return ååºç»æ |
| | | */ |
| | |
| | | work.setDeptId(data.getDeptId()); |
| | | work.setCompanyId(data.getCompanyId()); |
| | | work.setUpdateTime(new Date()); |
| | | work.setTitle(data.getName()+"-审æ¹"); |
| | | work.setTitle(data.getName() + "-审æ¹"); |
| | | work.setConfId(conf.getId()); |
| | | work.setStatus(WorkStatus.STATUS_30.getCode()); |
| | | work.setReceiveTime(new Date()); |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®å½åèç¹è·åä¸ä¸ä¸ªèç¹ |
| | | * |
| | | * @param curNode |
| | | * @param conf |
| | | * @return |
| | |
| | | /** |
| | | * |
| | | * æ ¹æ®åºå
¥åºéç¥åå¯å¨å®¡æ¹å·¥å |
| | | * |
| | | * @param data åºå
¥åºå·¥åæ°æ® |
| | | * @return ååºç»æ |
| | | */ |
| | | public BaseResp startByBackMoney(PledgeContract data, WorkOrderConf conf) { |
| | | public BaseResp startByBackMoney(PledgeContract data, WorkOrderConf conf, List<PledgeReminders> remindersList) { |
| | | |
| | | if (null == conf) conf = confService.getByDeptId(data.getPledgeDept(), WorkBizType.TYPE_10); |
| | | |
| | | if (Constant.YN_N.equals(conf.getValTag())) return BaseResp.error("æµç¨æªå¯ç¨"); |
| | | |
| | | //å建工å |
| | | StringBuilder description = new StringBuilder("å½ååå<" + data.getName() + ">ä¸"); |
| | | if (!remindersList.isEmpty()) { |
| | | Double sumMoneyNum = 0.0; |
| | | DecimalFormat df = new DecimalFormat("0.00"); |
| | | |
| | | for (PledgeReminders reminders : remindersList) { |
| | | description.append("ï¼ä»åº<").append(reminders.getDepotName()).append(">ï¼è´¨æ¼ç©<").append(reminders.getFoodVarietyName()).append(">åºåé为").append(df.format(reminders.getStorageReal())).append("kgï¼åä»·").append(reminders.getFoodPrice()).append("å
ï¼"); |
| | | sumMoneyNum += reminders.getStorageReal() * reminders.getFoodPrice(); |
| | | } |
| | | description.append("åºåéæ»éé¢ä¸º").append(df.format(sumMoneyNum)).append("å
ï¼è¾¾å°ååå¾
è¿æ¬¾éé¢ç110%,请æéä¼ä¸è¿æ¬¾è¿æ¬¾"); |
| | | } else { |
| | | description.append("è´¨æ¼ä»åº<").append(data.getDepotNames()).append(">åºåééé¢é«äºå¾
è¿æ¬¾éé¢ï¼éè¦è¿è¡è¿æ¬¾"); |
| | | } |
| | | WorkOrder work = new WorkOrder(); |
| | | work.setId(ContextUtil.generateOrderId("WARN")); |
| | | work.setBizType(WorkBizType.TYPE_50.getCode()); |
| | |
| | | work.setConfId(conf.getId()); |
| | | work.setStatus(WorkStatus.STATUS_30.getCode()); |
| | | work.setReceiveTime(new Date()); |
| | | |
| | | work.setDescription("å½ååå<" + data.getName() + ">ä¸è´¨æ¼ä»åº<" + data.getDepotNames() + ">åºåééé¢é«äºå¾
è¿æ¬¾éé¢ï¼éè¦è¿è¡è¿æ¬¾ï¼"); |
| | | |
| | | work.setDescription(description.toString()); |
| | | work.setCreateBy("ç³»ç»çæ"); |
| | | work.setCreateById("sys"); |
| | | work.setUpdateBy("ç³»ç»çæ"); |
| | |
| | | |
| | | /** |
| | | * è·åå¾
å¤çå·¥å |
| | | * |
| | | * @return å¤çç»æ |
| | | */ |
| | | public BaseResp todoByProcess(WorkOrderProcess process) { |
| | |
| | | return BaseResp.error("å½åå·¥åå·²å¤çï¼è¯·å·æ°é¡µé¢éè¯ï¼ï¼"); |
| | | } |
| | | |
| | | |
| | | //夿æ¯ä¸æ¯æå®å¤ç人 |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | if (StringUtils.isNotEmpty(work.getAssigneeId())) { |
| | |
| | | //è·åé
ç½®ä¿¡æ¯ |
| | | WorkOrderConf conf = confService.selectById(work.getConfId()); |
| | | if (null == conf) return BaseResp.error("å½åå·¥åæªé
ç½®æµç¨"); |
| | | |
| | | |
| | | //æ·»å è®°å½ |
| | | process.setId(ContextUtil.UUID()); |
| | |
| | | work.setAssigneeId(process.getAssigneeId()); |
| | | work.setNode(nextNode.getCode()); |
| | | orderService.complete(work); |
| | | }else{ |
| | | } else { |
| | | work.setNode(nextNode.getCode()); |
| | | work.setStatus(WorkStatus.STATUS_30.getCode()); |
| | | orderService.updateData(work); |
| | |
| | | work.setStatus(WorkStatus.STATUS_60.getCode()); |
| | | |
| | | orderService.complete(work); |
| | | |
| | | |
| | | //å¢å 审æ¹è®°å½ |
| | | orderProcessService.addData(process, true); |
| | | |
| | |
| | | |
| | | // work.setAssigneeName(process.getAssigneeName()); |
| | | // work.setAssigneeId(process.getAssigneeId()); |
| | | |
| | | |
| | | orderService.complete(work); |
| | | |