|
|
@ -4,19 +4,20 @@ import com.example.demo.Dao.productHistroyMapper;
|
|
|
|
import com.example.demo.Dao.productMapper;
|
|
|
|
import com.example.demo.Dao.productMapper;
|
|
|
|
import com.example.demo.bean.Product;
|
|
|
|
import com.example.demo.bean.Product;
|
|
|
|
import com.example.demo.bean.ProductHistroy;
|
|
|
|
import com.example.demo.bean.ProductHistroy;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
//@Service
|
|
|
|
@Service
|
|
|
|
public class updatePro {
|
|
|
|
public class updatePro {
|
|
|
|
// @Autowired
|
|
|
|
private nowTime nowTime=new nowTime();
|
|
|
|
private com.example.demo.productService.service.nowTime nowTime;
|
|
|
|
@Autowired
|
|
|
|
// @Autowired
|
|
|
|
|
|
|
|
private productMapper productMapper;
|
|
|
|
private productMapper productMapper;
|
|
|
|
//@Autowired
|
|
|
|
@Autowired
|
|
|
|
private productHistroyMapper proHisMapper;
|
|
|
|
private productHistroyMapper proHisMapper;
|
|
|
|
//@Autowired
|
|
|
|
|
|
|
|
private ProductHistroy productHistroy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int update(Product product1){
|
|
|
|
public int update(Product product1){
|
|
|
|
|
|
|
|
ProductHistroy productHistroy = new ProductHistroy();
|
|
|
|
|
|
|
|
if(productMapper.selectProductByProductNum(product1.getProductNum())==null)return -1;
|
|
|
|
productMapper.updateProduct(product1);
|
|
|
|
productMapper.updateProduct(product1);
|
|
|
|
productHistroy.setProductNum(product1.getProductNum());
|
|
|
|
productHistroy.setProductNum(product1.getProductNum());
|
|
|
|
productHistroy.setProductName(product1.getProductName());
|
|
|
|
productHistroy.setProductName(product1.getProductName());
|
|
|
|