修改流通时,使用时数量计算

dev_unify
yewj 6 months ago
parent ab34a60b64
commit 70ce57e267

@ -712,10 +712,18 @@ public class IoCodeTempController extends BaseController {
BeanUtils.copyProperties(exitLocalEntity, genDetaiEntity);
genDetaiEntity.setCount(1);
genDetaiEntity.setReCount(udiCalCountUtil.getActCount(udiRelevanceResponses.get(0)));
if (bussinessTypeEntity.isUse()) {
genDetaiEntity.setReCount(udiCalCountUtil.getUseActCount(udiRelevanceResponses.get(0)));
} else {
genDetaiEntity.setReCount(udiCalCountUtil.getCirActCount(udiRelevanceResponses.get(0)));
}
exitLocalEntity.setCount(exitLocalEntity.getMyCount() + 1);
exitLocalEntity.setReCount(exitLocalEntity.getMyCount() * udiCalCountUtil.getActCount(udiRelevanceResponses.get(0)));
if (bussinessTypeEntity.isUse()) {
exitLocalEntity.setReCount(IntUtil.value(exitLocalEntity.getMyReCount()) + udiCalCountUtil.getUseActCount(udiRelevanceResponses.get(0)));
} else {
exitLocalEntity.setReCount(IntUtil.value(exitLocalEntity.getMyReCount()) + udiCalCountUtil.getCirActCount(udiRelevanceResponses.get(0)));
}
if (StringUtils.isNotBlank(exitLocalEntity.getSerialNo())) {
@ -788,7 +796,11 @@ public class IoCodeTempController extends BaseController {
return ResultVOUtils.error(500, bussinessTypeEntity.getName() + "单只允许录入非集采产品!");
}
//计算实际数量
codeEnttity.setReCount(codeEnttity.getMyCount() * udiCalCountUtil.getActCount(udiRelevanceResponse));
if (bussinessTypeEntity.isUse()) {
codeEnttity.setReCount(codeEnttity.getMyReCount() + udiCalCountUtil.getUseActCount(udiRelevanceResponses.get(0)));
} else {
codeEnttity.setReCount(codeEnttity.getMyReCount() + udiCalCountUtil.getCirActCount(udiRelevanceResponses.get(0)));
}
} else if (udiRelevanceResponses.size() == 0) {
if (unitFk == null)
return ResultVOUtils.error(500, "耗材字典不存在此产品!");
@ -1036,10 +1048,19 @@ public class IoCodeTempController extends BaseController {
BeanUtils.copyProperties(exitLocalEntity, genDetaiEntity);
genDetaiEntity.setCount(1);
genDetaiEntity.setReCount(udiCalCountUtil.getActCount(udiRelevanceResponses.get(0)));
if (bussinessTypeEntity.isUse()) {
genDetaiEntity.setReCount(udiCalCountUtil.getUseActCount(udiRelevanceResponses.get(0)));
} else {
genDetaiEntity.setReCount(udiCalCountUtil.getCirActCount(udiRelevanceResponses.get(0)));
}
exitLocalEntity.setCount(exitLocalEntity.getMyCount() + 1);
exitLocalEntity.setReCount(exitLocalEntity.getMyCount() * udiCalCountUtil.getActCount(udiRelevanceResponses.get(0)));
if (bussinessTypeEntity.isUse()) {
exitLocalEntity.setReCount(exitLocalEntity.getMyReCount() * udiCalCountUtil.getUseActCount(udiRelevanceResponses.get(0)));
} else {
exitLocalEntity.setReCount(exitLocalEntity.getMyReCount() * udiCalCountUtil.getCirActCount(udiRelevanceResponses.get(0)));
}
if (StringUtils.isNotBlank(exitLocalEntity.getSerialNo())) {
@ -1114,7 +1135,11 @@ public class IoCodeTempController extends BaseController {
}
//计算实际数量
codeEnttity.setReCount(codeEnttity.getMyCount() * udiCalCountUtil.getActCount(udiRelevanceResponse));
if (bussinessTypeEntity.isUse()) {
codeEnttity.setReCount(IntUtil.value(codeEnttity.getMyReCount()) + udiCalCountUtil.getUseActCount(udiRelevanceResponse));
} else {
codeEnttity.setReCount(IntUtil.value(codeEnttity.getMyReCount()) + udiCalCountUtil.getCirActCount(udiRelevanceResponse));
}
} else if (udiRelevanceResponses.size() == 0) {
if (unitFk == null)
return ResultVOUtils.error(500, "药品字典不存在此产品!");
@ -1550,7 +1575,13 @@ public class IoCodeTempController extends BaseController {
}
IoCodeTempEntity tempEntity = codeTempService.selectById(codeTempEntity.getId());
codeTempEntity.setReCount(codeTempEntity.getMyCount() * udiCalCountUtil.getActCount(codeTempEntity.getNameCode()));
List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.selectGroupByNameCode(codeTempEntity.getNameCode(), null);
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(codeTempEntity.getAction());
if (bussinessTypeEntity.isUse()) {
codeTempEntity.setReCount(codeTempEntity.getMyCount() * udiCalCountUtil.getUseActCount(udiRelevanceResponses.get(0)));
} else {
codeTempEntity.setReCount(codeTempEntity.getMyCount() * udiCalCountUtil.getCirActCount(udiRelevanceResponses.get(0)));
}
int count = tempEntity.getCount() - codeTempEntity.getCount();
//更新扫码详情
@ -1559,7 +1590,12 @@ public class IoCodeTempController extends BaseController {
//扫码数量-1
int orderCount = orderDetailCodeEntity.getCount();
orderDetailCodeEntity.setCount(orderCount - count);
int reCount = count * udiCalCountUtil.getActCount(codeTempEntity.getNameCode());
int reCount = 0;
if (bussinessTypeEntity.isUse()) {
reCount = count * udiCalCountUtil.getUseActCount(udiRelevanceResponses.get(0));
} else {
reCount = count * udiCalCountUtil.getCirActCount(udiRelevanceResponses.get(0));
}
orderDetailCodeEntity.setReCount(IntUtil.value(orderDetailCodeEntity.getReCount()) - reCount);
ioOrderDetailCodeService.update(orderDetailCodeEntity);
}

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.glxp.api.constant.ConstantType;
import lombok.Data;
import java.util.Date;
@ -472,4 +473,20 @@ public class BasicBussinessTypeEntity {
*/
@TableField(value = "productType")
private Integer productType;
/**
* 使
*
* @return
*/
public Boolean isUse() {
// if (this.action.equals(ConstantType.SPLIT_RETURN) || this.action.equals(ConstantType.SPLIT_OUT)) {
// return true;
// }
if (this.corpType == 1)
return true;
return false;
}
}

@ -74,4 +74,27 @@ public class UdiCalCountUtil {
int count = getActCount(udiRelevanceResponse);
return count;
}
/**
*
*
* @return
*/
public int getCirActCount(UdiRelevanceResponse udiRelevanceResponse) {
if (udiRelevanceResponse.getBhltcjsl() == null || udiRelevanceResponse.getBhltcjsl() == 0)
return 1;
else return udiRelevanceResponse.getBhltcjsl();
}
/**
* 使
*
* @return
*/
public int getUseActCount(UdiRelevanceResponse udiRelevanceResponse) {
if (udiRelevanceResponse.getBhsycjsl() == null || udiRelevanceResponse.getBhsycjsl() == 0)
return 1;
else return udiRelevanceResponse.getBhsycjsl();
}
}

Loading…
Cancel
Save